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; }