render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
43fe83
From f972546d4131686a85f5d124e9feec49b77419c1 Mon Sep 17 00:00:00 2001
43fe83
Message-Id: <f972546d4131686a85f5d124e9feec49b77419c1.1377873641.git.jdenemar@redhat.com>
43fe83
From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
43fe83
Date: Wed, 28 Aug 2013 10:24:10 +0200
43fe83
Subject: [PATCH] virsh: free the formatting string when listing pool details
43fe83
43fe83
https://bugzilla.redhat.com/show_bug.cgi?id=1001957
43fe83
43fe83
==23== 41 bytes in 1 blocks are definitely lost in loss record 626 of 727
43fe83
==23==    by 0x4F0099F: virAsprintfInternal (virstring.c:358)
43fe83
==23==    by 0x15D2C9: cmdPoolList (virsh-pool.c:1268)
43fe83
43fe83
https://bugzilla.redhat.com/show_bug.cgi?id=1001536
43fe83
(cherry picked from commit 785ff34bf884a721544ea531c000e8a140e485fa)
43fe83
---
43fe83
 tools/virsh-pool.c | 3 ++-
43fe83
 1 file changed, 2 insertions(+), 1 deletion(-)
43fe83
43fe83
diff --git a/tools/virsh-pool.c b/tools/virsh-pool.c
43fe83
index b8fc8d7..e31e76c 100644
43fe83
--- a/tools/virsh-pool.c
43fe83
+++ b/tools/virsh-pool.c
43fe83
@@ -1264,7 +1264,7 @@ cmdPoolList(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
43fe83
     /* Create the output template.  Each column is sized according to
43fe83
      * the longest string.
43fe83
      */
43fe83
-    char *outputStr;
43fe83
+    char *outputStr = NULL;
43fe83
     ret = virAsprintf(&outputStr,
43fe83
               "%%-%lus  %%-%lus  %%-%lus  %%-%lus  %%%lus  %%%lus  %%%lus\n",
43fe83
               (unsigned long) nameStrLength,
43fe83
@@ -1319,6 +1319,7 @@ asprintf_failure:
43fe83
     functionReturn = false;
43fe83
 
43fe83
 cleanup:
43fe83
+    VIR_FREE(outputStr);
43fe83
     if (list && list->npools) {
43fe83
         for (i = 0; i < list->npools; i++) {
43fe83
             VIR_FREE(poolInfoTexts[i].state);
43fe83
-- 
43fe83
1.8.3.2
43fe83