]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3449] fixed fd and memory leak
authorRazvan Becheriu <razvan@isc.org>
Fri, 14 Jun 2024 05:43:19 +0000 (08:43 +0300)
committerRazvan Becheriu <razvan@isc.org>
Tue, 2 Jul 2024 11:22:40 +0000 (14:22 +0300)
src/hooks/dhcp/high_availability/ha_callouts.cc

index 2e4410983b3be70478d7d10c2d00f7e120764c5b..58a0f7dbf9822bfddfdbd6ea2bcf345f4c86c874 100644 (file)
@@ -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);
 }