From 2be4a6428cb19bb56c92cb074e5315474ae5b698 Mon Sep 17 00:00:00 2001 From: Lior Dotan Date: Thu, 29 Jun 2017 15:37:27 +0300 Subject: [PATCH] use parsed_hosts_file_ptr only if it has valid value --- iocore/hostdb/HostDB.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/iocore/hostdb/HostDB.cc b/iocore/hostdb/HostDB.cc index 2cb18b9d7b3..57295bb5890 100644 --- a/iocore/hostdb/HostDB.cc +++ b/iocore/hostdb/HostDB.cc @@ -2306,7 +2306,8 @@ ParseHostFile(const char *path, unsigned int hostdb_hostfile_check_interval) } // Swap the pointer - hostDB.hosts_file_ptr = parsed_hosts_file_ptr; + if (parsed_hosts_file_ptr != nullptr) + hostDB.hosts_file_ptr = parsed_hosts_file_ptr; // Mark this one as completed, so we can allow another update to happen HostDBFileUpdateActive = 0; }