]> xenbits.xensource.com Git - libvirt.git/commitdiff
xenParseXLVnuma: Don't leak @tmp and @token
authorMichal Privoznik <mprivozn@redhat.com>
Wed, 6 Dec 2017 13:56:30 +0000 (14:56 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 12 Dec 2017 15:41:01 +0000 (16:41 +0100)
==30399== 180 (144 direct, 36 indirect) bytes in 3 blocks are definitely lost in loss record 91 of 111
==30399==    at 0x4C2E0FF: realloc (vg_replace_malloc.c:785)
==30399==    by 0x5574572: virReallocN (viralloc.c:245)
==30399==    by 0x5574668: virExpandN (viralloc.c:294)
==30399==    by 0x55747AB: virResizeN (viralloc.c:352)
==30399==    by 0x560074D: virStringSplitCount (virstring.c:115)
==30399==    by 0x137A59: xenParseXLVnuma (xen_xl.c:442)
==30399==    by 0x13952B: xenParseXL (xen_xl.c:1064)
==30399==    by 0x11884D: testCompareFormatXML (xlconfigtest.c:152)
==30399==    by 0x118A87: testCompareHelper (xlconfigtest.c:207)
==30399==    by 0x119E36: virTestRun (testutils.c:180)
==30399==    by 0x119186: mymain (xlconfigtest.c:274)
==30399==    by 0x11BEE3: virTestMain (testutils.c:1119)

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

index 532d6677b42efca3e5d214b52d6b098ddbddc2ec..2ef80eb83a410153ff69eca75e18f63003220722 100644 (file)
@@ -436,9 +436,11 @@ xenParseXLVnuma(virConfPtr conf,
                             goto cleanup;
                         }
 
+                        VIR_FREE(tmp);
                         if (VIR_STRDUP(tmp, vtoken) < 0)
                             goto cleanup;
 
+                        virStringListFree(token);
                         if (!(token = virStringSplitCount(tmp, ",", 0, &ndistances)))
                             goto cleanup;