]> xenbits.xensource.com Git - libvirt.git/commitdiff
util: Resolve resource leak
authorJohn Ferlan <jferlan@redhat.com>
Wed, 11 Oct 2017 20:56:58 +0000 (16:56 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Thu, 12 Oct 2017 22:27:00 +0000 (18:27 -0400)
Need to free @groups in the parent on success similar to other
APIs (virFile*) which use virGetGroupList and virFork.

Reported by Coverity.

src/util/vircommand.c

index 41a61da49f82247c5c37782f837ea20b31681dce..6cd76a560e865d50952407a8f83ed509fc27f40d 100644 (file)
@@ -606,6 +606,7 @@ virExec(virCommandPtr cmd)
 
         cmd->pid = pid;
 
+        VIR_FREE(groups);
         VIR_FREE(binarystr);
 
         return 0;