]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
vmx: Free @firmware in virVMXParseConfig
authorMichal Privoznik <mprivozn@redhat.com>
Sat, 20 Apr 2019 05:01:04 +0000 (07:01 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 23 Apr 2019 08:59:01 +0000 (10:59 +0200)
The @firmware string is allocated, but never freed.

 4 bytes in 1 blocks are definitely lost in loss record 1 of 44
    at 0x483579F: malloc (vg_replace_malloc.c:299)
    by 0x76FB469: strdup (strdup.c:42)
    by 0x497B6DE: virStrdup (virstring.c:966)
    by 0x48F6FD3: virConfGetValueString (virconf.c:908)
    by 0x4B3E9B6: virVMXGetConfigStringHelper (vmx.c:736)
    by 0x4B3EA6B: virVMXGetConfigString (vmx.c:756)
    by 0x4B41AEA: virVMXParseConfig (vmx.c:1832)
    by 0x10B8E4: testCompareFiles (vmx2xmltest.c:79)
    by 0x10BAB8: testCompareHelper (vmx2xmltest.c:124)
    by 0x10D058: virTestRun (testutils.c:174)
    by 0x10CDDA: mymain (vmx2xmltest.c:288)
    by 0x10F11C: virTestMain (testutils.c:1096)

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Pino Toscano <ptoscano@redhat.com>
src/vmx/vmx.c

index 35b83a2320c247b28714e101f08a759c212e8b62..7bb5eb956deae7a00e46a701b2e2af41003d771c 100644 (file)
@@ -1861,6 +1861,7 @@ virVMXParseConfig(virVMXContext *ctx,
     VIR_FREE(sched_cpu_shares);
     VIR_FREE(guestOS);
     virCPUDefFree(cpu);
+    VIR_FREE(firmware);
 
     return def;
 }