]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#639,!410] check for null pointer
authorRazvan Becheriu <razvan@isc.org>
Thu, 4 Jul 2019 02:06:35 +0000 (05:06 +0300)
committerRazvan Becheriu <razvan@isc.org>
Thu, 4 Jul 2019 16:40:27 +0000 (19:40 +0300)
src/lib/dhcpsrv/host_mgr.cc

index 4ed8b9ee23faa5c7b24a382d7ce9a92ae46aab5a..6903d9ce843c42c154cc283ec109e9dc4640c654 100644 (file)
@@ -48,7 +48,8 @@ HostMgr::addBackend(const std::string& access) {
 
 bool
 HostMgr::delBackend(const std::string& db_type) {
-    if (getHostMgrPtr()->cache_ptr_->getType() == db_type) {
+    if (getHostMgrPtr()->cache_ptr_ &&
+        getHostMgrPtr()->cache_ptr_->getType() == db_type) {
         getHostMgrPtr()->cache_ptr_.reset();
     }
     return (HostDataSourceFactory::del(getHostMgrPtr()->alternate_sources_, db_type));