render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
43fe83
From 8a44f62f8d1858ebab7f2bbb890d5f3eb2d2b316 Mon Sep 17 00:00:00 2001
43fe83
Message-Id: <8a44f62f8d1858ebab7f2bbb890d5f3eb2d2b316.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:13 +0200
43fe83
Subject: [PATCH] virsh: free messages after logging them to a file
43fe83
43fe83
https://bugzilla.redhat.com/show_bug.cgi?id=1001957
43fe83
43fe83
The messages were only freed on error.
43fe83
43fe83
==12== 1,100 bytes in 1 blocks are definitely lost in loss record 698 of 729
43fe83
==12==    by 0x4E98C22: virBufferAsprintf (virbuffer.c:294)
43fe83
==12==    by 0x12C950: vshOutputLogFile (virsh.c:2440)
43fe83
==12==    by 0x12880B: vshError (virsh.c:2254)
43fe83
==12==    by 0x131957: vshCommandOptDomainBy (virsh-domain.c:109)
43fe83
==12==    by 0x14253E: cmdStart (virsh-domain.c:3333)
43fe83
43fe83
https://bugzilla.redhat.com/show_bug.cgi?id=1001536
43fe83
(cherry picked from commit 66d124b45472addc10d286ca291aa5411fcb381f)
43fe83
---
43fe83
 tools/virsh.c | 1 +
43fe83
 1 file changed, 1 insertion(+)
43fe83
43fe83
diff --git a/tools/virsh.c b/tools/virsh.c
43fe83
index 34f5c4a..d1ae183 100644
43fe83
--- a/tools/virsh.c
43fe83
+++ b/tools/virsh.c
43fe83
@@ -2479,6 +2479,7 @@ vshOutputLogFile(vshControl *ctl, int log_level, const char *msg_format,
43fe83
     if (safewrite(ctl->log_fd, str, len) < 0)
43fe83
         goto error;
43fe83
 
43fe83
+    VIR_FREE(str);
43fe83
     return;
43fe83
 
43fe83
 error:
43fe83
-- 
43fe83
1.8.3.2
43fe83