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

[libvirt] [PATCH] network: avoid memory leak on cleanup



* src/network/bridge_driver.c: Fix memory leak on cleanup section from
  networkGetBridgeName function.
---
 src/network/bridge_driver.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index 0a12bc0..59e780d 100644
--- a/src/network/bridge_driver.c
+++ b/src/network/bridge_driver.c
@@ -2474,7 +2474,8 @@ static char *networkGetBridgeName(virNetworkPtr net) {
 cleanup:
     if (network)
         virNetworkObjUnlock(network);
-    return bridge;
+    VIR_FREE(bridge);
+    return NULL;
 }
 
 static int networkGetAutostart(virNetworkPtr net,
-- 
1.7.1


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