]> xenbits.xensource.com Git - libvirt.git/commit
qemuBuildHostNetStr: Don't leak @addr
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 21 Sep 2017 12:52:58 +0000 (14:52 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 21 Sep 2017 14:07:09 +0000 (16:07 +0200)
commit57d8afcf75ff7d3f6f83b46c12494aa8707de468
tree7cc213effee7b9408e5a805874b412487b1d83af
parent06f75ff2cb292e2658b4f2f6949c700550006272
qemuBuildHostNetStr: Don't leak @addr

The virSocketAddrFormat() allocates the string and it's caller
responsibility to free it afterwards.

==28857== 11 bytes in 1 blocks are definitely lost in loss record 37 of 168
==28857==    at 0x4C2BEDF: malloc (vg_replace_malloc.c:299)
==28857==    by 0x9A81D79: strdup (in /lib64/libc-2.23.so)
==28857==    by 0x5DA3BF0: virStrdup (virstring.c:902)
==28857==    by 0x5D96182: virSocketAddrFormatFull (virsocketaddr.c:427)
==28857==    by 0x5D95E13: virSocketAddrFormat (virsocketaddr.c:352)
==28857==    by 0x5706890: qemuBuildHostNetStr (qemu_command.c:3891)
==28857==    by 0x57138D3: qemuBuildInterfaceCommandLine (qemu_command.c:8597)
==28857==    by 0x5713D6A: qemuBuildNetCommandLine (qemu_command.c:8699)
==28857==    by 0x57176F6: qemuBuildCommandLine (qemu_command.c:10027)
==28857==    by 0x5769D61: qemuProcessCreatePretendCmd (qemu_process.c:6004)
==28857==    by 0x4056EC: testCompareXMLToArgv (qemuxml2argvtest.c:502)
==28857==    by 0x41DF40: virTestRun (testutils.c:180)

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
src/qemu/qemu_command.c