]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
util: Do not leak @handles in stop netlink event service
authorWang King <king.wang@huawei.com>
Thu, 18 May 2017 04:06:42 +0000 (12:06 +0800)
committerJohn Ferlan <jferlan@redhat.com>
Thu, 18 May 2017 11:26:05 +0000 (07:26 -0400)
Commit e3ba4025 introduced srv->handles and VIR_RESIZE_N to allocate
@handles as necessary, but did not free the handles during when calling
virNetlinkEventServiceStop.

src/util/virnetlink.c

index 32fe13525996183a589f92557a6ea03d4f8e9a03..d732fe8cf3f477ff161d236c8e916e512dce3120 100644 (file)
@@ -758,6 +758,7 @@ virNetlinkEventServiceStop(unsigned int protocol)
     }
 
     server[protocol] = NULL;
+    VIR_FREE(srv->handles);
     virNetlinkEventServerUnlock(srv);
 
     virMutexDestroy(&srv->lock);