[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH] bridge: avoid double free



On 12/20/2010 06:31 AM, Paweł Krześniak wrote:
---
  src/network/bridge_driver.c |    1 -
  1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index c3f32d7..b0834ae 100644
--- a/src/network/bridge_driver.c
+++ b/src/network/bridge_driver.c
@@ -557,7 +557,6 @@ dhcpStartDhcpDaemon(virNetworkObjPtr network)

      cmd = virCommandNew(DNSMASQ);
      if (networkBuildDnsmasqArgv(network, pidfile, cmd)<  0) {
-        VIR_FREE(pidfile);
          goto cleanup;
      }

Technically not a double free, since VIR_FREE will set the pointer to NULL, turning the second call (at cleanup) into a NOP, but still a worthwhile cleanup.

This crept in when I recently converted the function from virRun to virCommand - previously there had been a "return -1" after this VIR_FREE(), and I changed it to "goto cleanup" so there was a single exit point from the function.

ACK. I added your name to the AUTHORS file and pushed the result.

Thanks for picking this out! Since it seems you've been looking through bridge_driver.c in a fair amount of detail, maybe you'd like to take a look at the patches I just posted this morning to support IPv6 in the bridge driver:

https://www.redhat.com/archives/libvir-list/2010-December/msg00765.html


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]