1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-01-09 01:18:00 +03:00

qemu: Fix memory leak in qemuDomainBlockJobSetSpeed()

fix 'device' leak in qemuDomainBlockJobSetSpeed

Signed-off-by: Jie Wang <wangjie88.huawei.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
w00251574 2018-06-25 22:15:36 +08:00 committed by Michal Privoznik
parent d63f1c6ad9
commit a03f5cddfc

View File

@ -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;