mirror of https://gitee.com/openkylin/libvirt.git
qemu: hotplug: Don't leak 'nodename' in qemuDomainChangeMediaBlockdev
qemuDomainDiskGetBackendAlias allocates a copy of the nodename string so we need to free it at the end. Found by Coverity. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
parent
c86735e2d8
commit
8aced2ea32
|
@ -700,6 +700,7 @@ qemuDomainChangeMediaBlockdev(virQEMUDriverPtr driver,
|
|||
cleanup:
|
||||
qemuHotplugDiskSourceDataFree(newbackend);
|
||||
qemuHotplugDiskSourceDataFree(oldbackend);
|
||||
VIR_FREE(nodename);
|
||||
/* caller handles correct exchange of sources */
|
||||
disk->src = oldsrc;
|
||||
return ret;
|
||||
|
|
Loading…
Reference in New Issue