From: Ján Tomko Date: Tue, 27 Aug 2013 11:07:27 +0000 (+0200) Subject: virsh: free messages after logging them to a file X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=66d124b45472addc10d286ca291aa5411fcb381f;p=libvirt.git virsh: free messages after logging them to a file 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 --- diff --git a/tools/virsh.c b/tools/virsh.c index 2ea44a6187..dfd3665831 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -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: