]> git.ipfire.org Git - thirdparty/libvirt.git/commit
virLogVMessage: Don't leak rawinitmsg
authorMichal Privoznik <mprivozn@redhat.com>
Wed, 6 Jan 2016 16:14:44 +0000 (17:14 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 8 Jan 2016 08:16:33 +0000 (09:16 +0100)
commit587fd1055413360d7b8422cc12720bab4f41ec41
treebf286df7495b46278bcdb6067a20d85effd89d95
parent9f7506488ac487ac82130e0bf2111ed7e39422b6
virLogVMessage: Don't leak rawinitmsg

Instead of misusing a const string to hold up runtime allocated
data, introduce new variable @hoststr and obey const correctness.

==6879== 15 bytes in 1 blocks are definitely lost in loss record 68 of 1,064
==6879==    at 0x4C29F80: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==6879==    by 0xA7DDF97: vasprintf (in /lib64/libc-2.21.so)
==6879==    by 0x552BBC6: virVasprintfInternal (virstring.c:493)
==6879==    by 0x552BCDB: virAsprintfInternal (virstring.c:514)
==6879==    by 0x54FA44C: virLogHostnameString (virlog.c:468)
==6879==    by 0x54FAB0F: virLogVMessage (virlog.c:645)
==6879==    by 0x54FA680: virLogMessage (virlog.c:531)
==6879==    by 0x54FBBF4: virLogParseOutputs (virlog.c:1130)
==6879==    by 0x11CB4F: daemonSetupLogging (libvirtd.c:685)
==6879==    by 0x11E137: main (libvirtd.c:1297)

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
src/util/virlog.c