This patch uses VIR_AUTOFREE on instances of 'unsigned int *'
and 'unsigned long long *' found in qemu_driver.c.
Suggested-by: Erik Skultety <eskultet(a)redhat.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413(a)gmail.com>
---
src/qemu/qemu_driver.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index fd7c8bb1be..6f283d2de3 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -1082,7 +1082,7 @@ qemuStateStop(void)
size_t i;
int state;
virDomainPtr *domains = NULL;
- unsigned int *flags = NULL;
+ VIR_AUTOFREE(unsigned int *) flags = NULL;
VIR_AUTOUNREF(virQEMUDriverConfigPtr) cfg = virQEMUDriverGetConfig(qemu_driver);
if (!(conn = virConnectOpen(cfg->uri)))
@@ -1120,7 +1120,6 @@ qemuStateStop(void)
virObjectUnref(domains[i]);
VIR_FREE(domains);
}
- VIR_FREE(flags);
return ret;
}
@@ -20715,7 +20714,7 @@ qemuDomainGetStatsVcpu(virQEMUDriverPtr driver,
size_t i;
int ret = -1;
virVcpuInfoPtr cpuinfo = NULL;
- unsigned long long *cpuwait = NULL;
+ VIR_AUTOFREE(unsigned long long *) cpuwait = NULL;
if (virTypedParamListAddUInt(params, virDomainDefGetVcpus(dom->def),
"vcpu.current") < 0)
@@ -20780,7 +20779,6 @@ qemuDomainGetStatsVcpu(virQEMUDriverPtr driver,
cleanup:
VIR_FREE(cpuinfo);
- VIR_FREE(cpuwait);
return ret;
}
--
2.21.0