{
// 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;
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;
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;