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
This commit is contained in:
Ján Tomko 2013-08-27 13:07:27 +02:00
parent 2d9185a9f3
commit 66d124b454

View 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: