From: Razvan Becheriu Date: Fri, 14 Jun 2024 05:43:19 +0000 (+0300) Subject: [#3449] fixed fd and memory leak X-Git-Tag: Kea-2.7.1~56 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0fe6f2e3812e27f923f392126f42da4c216e2cfd;p=thirdparty%2Fkea.git [#3449] fixed fd and memory leak --- diff --git a/src/hooks/dhcp/high_availability/ha_callouts.cc b/src/hooks/dhcp/high_availability/ha_callouts.cc index 2e4410983b..58a0f7dbf9 100644 --- a/src/hooks/dhcp/high_availability/ha_callouts.cc +++ b/src/hooks/dhcp/high_availability/ha_callouts.cc @@ -429,10 +429,12 @@ int load(LibraryHandle& handle) { /// @return 0 if deregistration was successful, 1 otherwise int unload() { if (impl) { - IOServiceMgr::instance().unregisterIOService(impl->getIOService()); - impl->getIOService()->stopAndPoll(); + IOServicePtr io_service = impl->getIOService(); + IOServiceMgr::instance().unregisterIOService(io_service); + io_service->stopAndPoll(); + impl.reset(); + io_service->stopAndPoll(); } - impl.reset(); LOG_INFO(ha_logger, HA_DEINIT_OK); return (0); }