From c55450f04e5641d6fc9c2db6e18189c6afb7759c Mon Sep 17 00:00:00 2001 From: Davin McCall Date: Thu, 26 Dec 2019 04:15:27 +0000 Subject: [PATCH] Fix issue when service fails to load Introduced during earlier refactoring. --- src/load-service.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/load-service.cc b/src/load-service.cc index 3a777d3..fe39771 100644 --- a/src/load-service.cc +++ b/src/load-service.cc @@ -513,7 +513,7 @@ service_record * dirload_service_set::load_reload_service(const char *name, serv { // Must remove the dummy service record. if (dummy != nullptr) { - records.erase(std::find(records.begin(), records.end(), rval)); + records.erase(std::find(records.begin(), records.end(), dummy)); delete dummy; } if (create_new_record) delete rval; @@ -522,7 +522,7 @@ service_record * dirload_service_set::load_reload_service(const char *name, serv catch (std::system_error &sys_err) { if (dummy != nullptr) { - records.erase(std::find(records.begin(), records.end(), rval)); + records.erase(std::find(records.begin(), records.end(), dummy)); delete dummy; } if (create_new_record) delete rval; @@ -531,7 +531,7 @@ service_record * dirload_service_set::load_reload_service(const char *name, serv catch (...) // (should only be std::bad_alloc / service_description_exc) { if (dummy != nullptr) { - records.erase(std::find(records.begin(), records.end(), rval)); + records.erase(std::find(records.begin(), records.end(), dummy)); delete dummy; } if (create_new_record) delete rval; -- 2.25.1