]> git.ipfire.org Git - thirdparty/libvirt.git/commit
bhyvexml2argvtest: Avoid leaking firmwareDir
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 3 Feb 2026 11:10:00 +0000 (12:10 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 4 Feb 2026 07:29:38 +0000 (08:29 +0100)
commit720f71c1da41cf7c496153b878e2c09341f2cb28
tree7c902cd9e918a385e007b801323bacedd7b2fe5f
parent210cae66e0b6c26836e2af17717d046039b390fc
bhyvexml2argvtest: Avoid leaking firmwareDir

The firmwareDir member of driver config is set at the beginning
of mymain(). But then, roughly in the middle of test cases it is
overwritten to fakefirmwareemptydir. But this means the old value
must be freed. Or reassigned back to its original variable which
is freed automatically.

16 bytes in 1 blocks are definitely lost in loss record 190 of 505
   at 0x4883224: malloc (vg_replace_malloc.c:451)
   by 0x4EE6562: g_malloc (in /usr/local/lib/libglib-2.0.so.0.8400.4)
   by 0x4F0100F: g_strdup (in /usr/local/lib/libglib-2.0.so.0.8400.4)
   by 0x4013E26: g_strdup_inline (gstrfuncs.h:321)
   by 0x4013E26: mymain (bhyvexml2argvtest.c:151)
   by 0x40189A2: virTestMain (testutils.c:913)
   by 0x4013DE6: main (bhyvexml2argvtest.c:354)

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
tests/bhyvexml2argvtest.c