[libvirt] [PATCH v2] Fix memory leak in qemuBuildDriveStr()

Eric Blake eblake at redhat.com
Wed Dec 4 21:24:31 UTC 2013


On 12/04/2013 02:15 PM, Nehal J Wani wrote:
> This patch fixes memory leaks reported by valgrind on running qemuxml2argvtest
> 
> Most of them are of the form:
> 
> ==24777== 15 bytes in 1 blocks are definitely lost in loss record 39 of 129
> ==24777==    at 0x4A0887C: malloc (vg_replace_malloc.c:270)
> ==24777==    by 0x341F485E21: strdup (strdup.c:42)
> ==24777==    by 0x4CADE5F: virStrdup (virstring.c:554)
> ==24777==    by 0x4362B6: qemuBuildDriveStr (qemu_command.c:3848)
> ==24777==    by 0x43EF73: qemuBuildCommandLine (qemu_command.c:8500)
> ==24777==    by 0x426670: testCompareXMLToArgvHelper (qemuxml2argvtest.c:350)
> ==24777==    by 0x427C01: virtTestRun (testutils.c:138)
> ==24777==    by 0x41DDB5: mymain (qemuxml2argvtest.c:658)
> ==24777==    by 0x4282A2: virtTestMain (testutils.c:593)
> ==24777==    by 0x341F421A04: (below main) (libc-start.c:225)
> ==24777==
> 
> ---
>  v2: Modified according to Eric's comments.
> 
>  src/qemu/qemu_command.c | 2 ++
>  1 file changed, 2 insertions(+)

ACK and pushed.  I tweaked the commit message to mention that the leak
was introduced in commit 0df53f.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 621 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20131204/0d1eb3ad/attachment-0001.sig>


More information about the libvir-list mailing list