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

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



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 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


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