From: John Ferlan Date: Wed, 2 Dec 2020 12:43:15 +0000 (-0500) Subject: util: Fix memory leak in virNetDevOpenvswitchInterfaceGetMaster X-Git-Tag: v7.0.0-rc1~356 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3d48ce9437e8cd35e469676ae3a68701f3dc49a6;p=thirdparty%2Flibvirt.git util: Fix memory leak in virNetDevOpenvswitchInterfaceGetMaster 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 Reviewed-by: Ján Tomko Signed-off-by: Ján Tomko --- 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;