[PATCH 1/7] util: Fix memory leak in virNetDevOpenvswitchInterfaceGetMaster

John Ferlan jferlan at redhat.com
Wed Dec 2 12:43:15 UTC 2020


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 at redhat.com>
---
 src/util/virnetdevopenvswitch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/util/virnetdevopenvswitch.c b/src/util/virnetdevopenvswitch.c
index 7452527f49..d380b0cf22 100644
--- a/src/util/virnetdevopenvswitch.c
+++ b/src/util/virnetdevopenvswitch.c
@@ -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;
-- 
2.28.0




More information about the libvir-list mailing list