Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx> --- src/qemu/qemu_domain.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 74d5186bc7..362b860c73 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -3094,20 +3094,13 @@ virDomainXMLPrivateDataCallbacks virQEMUDriverPrivateDataCallbacks = { static void qemuDomainXmlNsDefFree(qemuDomainXmlNsDefPtr def) { - size_t i; - if (!def) return; - for (i = 0; i < def->num_args; i++) - VIR_FREE(def->args[i]); - for (i = 0; i < def->num_env; i++) { - VIR_FREE(def->env_name[i]); - VIR_FREE(def->env_value[i]); - } - VIR_FREE(def->args); - VIR_FREE(def->env_name); - VIR_FREE(def->env_value); + virStringListFreeCount(def->args, def->num_args); + virStringListFreeCount(def->env_name, def->num_env); + virStringListFreeCount(def->env_value, def->num_env); + VIR_FREE(def); } -- 2.21.0 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list