[PATCH 3/4] rpc: fix resource leak

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

 



Commit 252610f7dd1 switched to use hash to store servers.
Function virHashGetItems returns allocated array which needs
to be freed also for successful path, not only if there is
an error.

Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx>
---
 src/rpc/virnetdaemon.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/rpc/virnetdaemon.c b/src/rpc/virnetdaemon.c
index dcc89fa097..fabacf2039 100644
--- a/src/rpc/virnetdaemon.c
+++ b/src/rpc/virnetdaemon.c
@@ -401,6 +401,7 @@ virNetDaemonPreExecRestart(virNetDaemonPtr dmn)
         }
     }
 
+    VIR_FREE(srvArray);
     virObjectUnlock(dmn);
 
     return object;
-- 
2.12.2

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