From: Davin McCall Date: Thu, 26 Dec 2019 04:15:27 +0000 (+0000) Subject: Fix issue when service fails to load X-Git-Tag: v0.8.1~14 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=c55450f04e5641d6fc9c2db6e18189c6afb7759c;p=oweals%2Fdinit.git Fix issue when service fails to load Introduced during earlier refactoring. --- 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;