[PATCH] virsh: fix memory leak in cmdNetworkInfo

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

 



I have ever discussed this issue with Matthias, and he has fixed this leak in
cmdNetworkInfo codes, but he hasn't committed a patch to upstream so that 
bug 722806 is always assigned status, so commit it to avoid this patch missing. 

* tools/virsh.c: avoid memory leak in cmdNetworkInfo.

* how to reproduce?
  % valgrind -v --leak-check=yes virsh net-info default

  https://bugzilla.redhat.com/show_bug.cgi?id=722806

Signed-off-by: Alex Jia <ajia@xxxxxxxxxx>
---
 tools/virsh.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/tools/virsh.c b/tools/virsh.c
index 23e71d7..cf8e2a5 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -5597,6 +5597,7 @@ cmdNetworkInfo(vshControl *ctl, const vshCmd *cmd)
     if (bridge)
         vshPrint(ctl, "%-15s %s\n", _("Bridge:"), bridge);
 
+    VIR_FREE(bridge);
     virNetworkFree(network);
     return true;
 }
-- 
1.7.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]