[libvirt] [PATCH] util: Resolve resource leak

John Ferlan jferlan at redhat.com
Wed Oct 11 21:03:05 UTC 2017


Need to free @groups in the parent on success similar to other
APIs (virFile*) which use virGetGroupList and virFork.

Reported by Coverity.

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

diff --git a/src/util/vircommand.c b/src/util/vircommand.c
index 41a61da49f..6cd76a560e 100644
--- a/src/util/vircommand.c
+++ b/src/util/vircommand.c
@@ -606,6 +606,7 @@ virExec(virCommandPtr cmd)
 
         cmd->pid = pid;
 
+        VIR_FREE(groups);
         VIR_FREE(binarystr);
 
         return 0;
-- 
2.13.6




More information about the libvir-list mailing list