[libvirt] [PATCH 1/3] xenParseXLVnuma: Don't leak @tmp and @token

Michal Privoznik mprivozn at redhat.com
Tue Dec 12 14:10:35 UTC 2017


==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 at redhat.com>
---
 src/xenconfig/xen_xl.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/xenconfig/xen_xl.c b/src/xenconfig/xen_xl.c
index 532d6677b..2ef80eb83 100644
--- a/src/xenconfig/xen_xl.c
+++ b/src/xenconfig/xen_xl.c
@@ -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;
 
-- 
2.13.6




More information about the libvir-list mailing list