[libvirt] [PATCH 1/8] libxl: Resolve Coverity RESOURCE_LEAK

John Ferlan jferlan at redhat.com
Tue May 5 11:34:26 UTC 2015


The returned socks from virNetSocketNewListenTCP needs to be VIR_FREE'd
as well as seach of the Close/Unref on all the socks[i] that is
already done

Signed-off-by: John Ferlan <jferlan at redhat.com>
---
 src/libxl/libxl_migration.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/libxl/libxl_migration.c b/src/libxl/libxl_migration.c
index 1efd98f..10b5bd6 100644
--- a/src/libxl/libxl_migration.c
+++ b/src/libxl/libxl_migration.c
@@ -445,6 +445,7 @@ libxlDomainMigrationPrepare(virConnectPtr dconn,
         virNetSocketClose(socks[i]);
         virObjectUnref(socks[i]);
     }
+    VIR_FREE(socks);
     /* Remove virDomainObj from domain list */
     if (vm) {
         virDomainObjListRemove(driver->domains, vm);
-- 
2.1.0




More information about the libvir-list mailing list