[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH 2/3] 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>
---
 src/qemu/qemu_hotplug.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 1a9a9e1a32..0b84a503bb 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -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;
-- 
2.16.2


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]