From 870282cb43a4b8b29273570ce1fd0a9767971a20 Mon Sep 17 00:00:00 2001 From: Julio Faracco Date: Wed, 14 Nov 2018 15:32:31 -0200 Subject: [PATCH] qemu: Using virStringListFreeCount instead VIR_FREE to free tmpPaths. The function qemuDomainGetHostdevPath() is using VIR_FREE to free the paths stored in tmpPaths. Both syntax analyzer are reporting a warning about this. Replacing the old method to function virStringListFreeCount() fixes the warnings/errors. Signed-off-by: Julio Faracco Reviewed-by: John Ferlan --- src/qemu/qemu_domain.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 37926850b2..c374219aab 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -11132,9 +11132,7 @@ qemuDomainGetHostdevPath(virDomainDefPtr def, } ret = 0; cleanup: - for (i = 0; i < tmpNpaths; i++) - VIR_FREE(tmpPaths[i]); - VIR_FREE(tmpPaths); + virStringListFreeCount(tmpPaths, tmpNpaths); VIR_FREE(tmpPerms); virPCIDeviceFree(pci); virUSBDeviceFree(usb);