[PATCH] admin_server: fix memory leak

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

 



If caller of adminConnectListServers() pass NULL instead of servers we
need to free the list we've received from virNetDaemonGetServers().

Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx>
---
 daemon/admin_server.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/daemon/admin_server.c b/daemon/admin_server.c
index 1d16bc9..2f26488 100644
--- a/daemon/admin_server.c
+++ b/daemon/admin_server.c
@@ -52,6 +52,8 @@ adminConnectListServers(virNetDaemonPtr dmn,
     if (servers) {
         *servers = srvs;
         srvs = NULL;
+    } else {
+        virObjectListFreeCount(srvs, ret);
     }
  cleanup:
     return ret;
-- 
2.7.4

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux