]> xenbits.xensource.com Git - libvirt.git/commitdiff
network: fix memory leak in networkBuildDhcpDaemonCommandLine()
authorLaine Stump <laine@redhat.com>
Fri, 19 Jun 2020 21:40:17 +0000 (17:40 -0400)
committerLaine Stump <laine@redhat.com>
Sun, 5 Jul 2020 03:52:34 +0000 (23:52 -0400)
hostsfilestr was not being freed. This will be turned into g_autofree
in an upcoming patch converting a lot more of the same file to using
g_auto*, but I wanted to make a separate patch for this first so the
other patch is simpler to review (and to make backporting easier).

The leak was introduced in commit 97a0aa246799c97d0a9ca9ecd6b4fd932ae4756c

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/network/bridge_driver.c

index 47d5d9567846bfd71cdc35f05622f0374b1d07ce..aff1b7b1bced3362579279fda9e498851ebcf1de 100644 (file)
@@ -1628,6 +1628,7 @@ networkBuildDhcpDaemonCommandLine(virNetworkDriverStatePtr driver,
     virObjectUnref(dnsmasq_caps);
     VIR_FREE(configfile);
     VIR_FREE(configstr);
+    VIR_FREE(hostsfilestr);
     VIR_FREE(leaseshelper_path);
     return ret;
 }