]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Using virStringListFreeCount instead VIR_FREE to free tmpPaths.
authorJulio Faracco <jcfaracco@gmail.com>
Wed, 14 Nov 2018 17:32:31 +0000 (15:32 -0200)
committerJohn Ferlan <jferlan@redhat.com>
Wed, 14 Nov 2018 20:07:28 +0000 (15:07 -0500)
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 <jcfaracco@gmail.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
src/qemu/qemu_domain.c

index 37926850b2acfe9181b4077333d06640f82a9c72..c374219aabf948908ffdee8d3742df1a052ba303 100644 (file)
@@ -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);