You need to sign in or sign up before continuing.
  • E
    nodedev: fix pci express memory leak · c6a4d268
    Eric Blake 提交于
    Leak introduced in commit 16ebf10f (v1.2.6), detected by valgrind:
    
    ==9816== 216 (96 direct, 120 indirect) bytes in 6 blocks are definitely lost in loss record 665 of 821
    ==9816==    at 0x4A081D4: calloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
    ==9816==    by 0x50836FB: virAlloc (viralloc.c:144)
    ==9816==    by 0x1DBDBE27: udevProcessPCI (node_device_udev.c:546)
    ==9816==    by 0x1DBDD79D: udevGetDeviceDetails (node_device_udev.c:1293)
    
    * src/util/virpci.h (virPCIEDeviceInfoFree): New prototype.
    * src/util/virpci.c (virPCIEDeviceInfoFree): New function.
    * src/conf/node_device_conf.c (virNodeDevCapsDefFree): Clear
    pci_express under pci case.
    (virNodeDevCapPCIDevParseXML): Avoid leak.
    * src/node_device/node_device_udev.c (udevProcessPCI): Likewise.
    * src/libvirt_private.syms (virpci.h): Export it.
    Signed-off-by: NEric Blake <eblake@redhat.com>
    c6a4d268
node_device_conf.c 62.2 KB