Skip to content

Commit 0fe6f2e

Browse files
author
Razvan Becheriu
committed
[#3449] fixed fd and memory leak
1 parent 67842fc commit 0fe6f2e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/hooks/dhcp/high_availability/ha_callouts.cc

+5-3
Original file line numberDiff line numberDiff line change
@@ -429,10 +429,12 @@ int load(LibraryHandle& handle) {
429429
/// @return 0 if deregistration was successful, 1 otherwise
430430
int unload() {
431431
if (impl) {
432-
IOServiceMgr::instance().unregisterIOService(impl->getIOService());
433-
impl->getIOService()->stopAndPoll();
432+
IOServicePtr io_service = impl->getIOService();
433+
IOServiceMgr::instance().unregisterIOService(io_service);
434+
io_service->stopAndPoll();
435+
impl.reset();
436+
io_service->stopAndPoll();
434437
}
435-
impl.reset();
436438
LOG_INFO(ha_logger, HA_DEINIT_OK);
437439
return (0);
438440
}

0 commit comments

Comments
 (0)