]> xenbits.xensource.com Git - libvirt.git/commitdiff
testUSBList: don't leak @dev
authorMichal Privoznik <mprivozn@redhat.com>
Fri, 3 Feb 2017 13:56:43 +0000 (14:56 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 10 Feb 2017 09:25:44 +0000 (10:25 +0100)
==22187== 77 (56 direct, 21 indirect) bytes in 1 blocks are definitely lost in loss record 23 of 37
==22187==    at 0x4C2BC75: calloc (vg_replace_malloc.c:624)
==22187==    by 0x4E75685: virAlloc (viralloc.c:144)
==22187==    by 0x4F0613A: virUSBDeviceNew (virusb.c:332)
==22187==    by 0x4F05BA2: virUSBDeviceSearch (virusb.c:183)
==22187==    by 0x4F05F95: virUSBDeviceFind (virusb.c:296)
==22187==    by 0x403514: testUSBList (virusbtest.c:209)
==22187==    by 0x403BD8: virTestRun (testutils.c:180)
==22187==    by 0x4039E5: mymain (virusbtest.c:285)
==22187==    by 0x4056BC: virTestMain (testutils.c:992)
==22187==    by 0x403A4A: main (virusbtest.c:293)

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
tests/virusbtest.c

index 4bbfe4af9616cf92b15519dd96741ad0fbcb8305..7cddb89afb1ad99e9acf979529f1ffa570693611 100644 (file)
@@ -217,6 +217,7 @@ testUSBList(const void *opaque ATTRIBUTE_UNUSED)
     }
 
     virUSBDeviceListDel(list, dev);
+    virUSBDeviceFree(dev);
     dev = NULL;
 
     if (testCheckNdevs("After deleting one",