[libvirt] [PATCH] virpcimock: Fix memory leak in pci_driver_new
13 Jul
2017
13 Jul
'17
8:49 a.m.
@driverpath, allocated by virAsprintfQuiet, was not freed and leaked. Signed-off-by: Zhipeng Lu <lu.zhipeng@zte.com.cn> --- tests/virpcimock.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/virpcimock.c b/tests/virpcimock.c index e9408aa..dec9e01 100644 --- a/tests/virpcimock.c +++ b/tests/virpcimock.c @@ -480,6 +480,7 @@ pci_driver_new(const char *name, int fail, ...) if (VIR_APPEND_ELEMENT_QUIET(pciDrivers, nPCIDrivers, driver) < 0) ABORT_OOM(); + VIR_FREE(driverpath); } static struct pciDriver * -- 1.8.3.1
3038
Age (days ago)
3038
Last active (days ago)
0 comments
1 participants
participants (1)
-
ZhiPeng Lu