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(a)redhat.com>
---
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;
}