[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH] util: do not leak handles in stop netlink event service



handles stored in virNetlinkEventSrvPrivatePtr should be freed when
stop netlink event service.
---
 src/util/virnetlink.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/util/virnetlink.c b/src/util/virnetlink.c
index 92ecf77..b782cfa 100644
--- a/src/util/virnetlink.c
+++ b/src/util/virnetlink.c
@@ -758,6 +758,7 @@ virNetlinkEventServiceStop(unsigned int protocol)
     }
 
     server[protocol] = NULL;
+    VIR_FREE(srv->handles);
     virNetlinkEventServerUnlock(srv);
 
     virMutexDestroy(&srv->lock);
@@ -796,6 +797,7 @@ virNetlinkEventServiceStopAll(void)
         }
 
         server[i] = NULL;
+        VIR_FREE(srv->handles);
         virNetlinkEventServerUnlock(srv);
 
         virMutexDestroy(&srv->lock);
-- 
2.8.3



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]