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

Re: [libvirt] [PATCH] virsh: fix memory leak in cmdNetworkInfo

于 2011年08月02日 16:31, Alex Jia 写道:
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


Signed-off-by: Alex Jia<ajia 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);
      return true;

Ack and pushed.


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