]> xenbits.xensource.com Git - libvirt.git/commitdiff
virsh: free messages after logging them to a file
authorJán Tomko <jtomko@redhat.com>
Tue, 27 Aug 2013 11:07:27 +0000 (13:07 +0200)
committerJán Tomko <jtomko@redhat.com>
Wed, 28 Aug 2013 06:05:56 +0000 (08:05 +0200)
The messages were only freed on error.

==12== 1,100 bytes in 1 blocks are definitely lost in loss record 698 of 729
==12==    by 0x4E98C22: virBufferAsprintf (virbuffer.c:294)
==12==    by 0x12C950: vshOutputLogFile (virsh.c:2440)
==12==    by 0x12880B: vshError (virsh.c:2254)
==12==    by 0x131957: vshCommandOptDomainBy (virsh-domain.c:109)
==12==    by 0x14253E: cmdStart (virsh-domain.c:3333)

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

tools/virsh.c

index 2ea44a6187ebbe4f6d812e737b6d6733547d5652..dfd3665831d5e15b4c714c09264932923f2ddc14 100644 (file)
@@ -2476,6 +2476,7 @@ vshOutputLogFile(vshControl *ctl, int log_level, const char *msg_format,
     if (safewrite(ctl->log_fd, str, len) < 0)
         goto error;
 
+    VIR_FREE(str);
     return;
 
 error: