]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
util: Fix memory leak in virNetDevOpenvswitchInterfaceGetMaster
authorJohn Ferlan <jferlan@redhat.com>
Wed, 2 Dec 2020 12:43:15 +0000 (07:43 -0500)
committerJán Tomko <jtomko@redhat.com>
Wed, 2 Dec 2020 15:15:43 +0000 (16:15 +0100)
Since 032548c4 @cmd was never autofree'd. Perhaps as a result of
VIR_AUTOPTR type changes occurring at roughly the same time so the
copy pasta missed this.

Found by Coverity.

Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
src/util/virnetdevopenvswitch.c

index 7452527f49feb95f9aa9e7d761733433a14ceaf2..d380b0cf22d0261583cdc73694b646174388d4d0 100644 (file)
@@ -428,7 +428,7 @@ virNetDevOpenvswitchInterfaceStats(const char *ifname,
 int
 virNetDevOpenvswitchInterfaceGetMaster(const char *ifname, char **master)
 {
-    virCommandPtr cmd = virNetDevOpenvswitchCreateCmd();
+    g_autoptr(virCommand) cmd = virNetDevOpenvswitchCreateCmd();
     int exitstatus;
 
     *master = NULL;