From a03f5cddfc07319effd30c92c764674942f203ae Mon Sep 17 00:00:00 2001 From: w00251574 Date: Mon, 25 Jun 2018 22:15:36 +0800 Subject: [PATCH] qemu: Fix memory leak in qemuDomainBlockJobSetSpeed() fix 'device' leak in qemuDomainBlockJobSetSpeed Signed-off-by: Jie Wang Signed-off-by: Michal Privoznik --- src/qemu/qemu_driver.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 921aafcd79..129bacdd34 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -17347,7 +17347,7 @@ qemuDomainBlockJobSetSpeed(virDomainPtr dom, virDomainDiskDefPtr disk; int ret = -1; virDomainObjPtr vm; - const char *device; + char *device = NULL; unsigned long long speed = bandwidth; virCheckFlags(VIR_DOMAIN_BLOCK_JOB_SPEED_BANDWIDTH_BYTES, -1); @@ -17395,6 +17395,7 @@ qemuDomainBlockJobSetSpeed(virDomainPtr dom, qemuDomainObjEndJob(driver, vm); cleanup: + VIR_FREE(device); virDomainObjEndAPI(&vm); return ret; -- GitLab