]> git.ipfire.org Git - thirdparty/libvirt.git/commit
Fix memory leak in qemuBuildDriveStr()
authorNehal J Wani <nehaljw.kkd1@gmail.com>
Wed, 4 Dec 2013 21:15:03 +0000 (02:45 +0530)
committerEric Blake <eblake@redhat.com>
Wed, 4 Dec 2013 21:23:50 +0000 (14:23 -0700)
commitf386d323e6ac28ea7ed65116830e68a2e8bf6263
treed2c2bf9354787ebef289d187e4f7f1446248b6cf
parentdf36af589f09e94af9d338b1cfb6136089889c4a
Fix memory leak in qemuBuildDriveStr()

This patch fixes memory leaks reported by valgrind on running
qemuxml2argvtest; introduced in commit 0df53f04.

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==

Signed-off-by: Eric Blake <eblake@redhat.com>
src/qemu/qemu_command.c