[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 03/20] spapr: fix memory leak in spapr_memory_pre_plug(
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PULL 03/20] spapr: fix memory leak in spapr_memory_pre_plug() |
Date: |
Fri, 9 Jun 2017 15:26:35 +1000 |
From: Greg Kurz <address@hidden>
The string returned by object_property_get_str() is dynamically allocated.
(Spotted by Coverity, CID 1375942)
Signed-off-by: Greg Kurz <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
hw/ppc/spapr.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 91b4057..9b7ae28 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -2615,8 +2615,11 @@ static void spapr_memory_pre_plug(HotplugHandler
*hotplug_dev, DeviceState *dev,
if (mem_dev && !kvmppc_is_mem_backend_page_size_ok(mem_dev)) {
error_setg(errp, "Memory backend has bad page size. "
"Use 'memory-backend-file' with correct mem-path.");
- return;
+ goto out;
}
+
+out:
+ g_free(mem_dev);
}
struct sPAPRDIMMState {
--
2.9.4
- [Qemu-ppc] [PULL 00/20] ppc-for-2.10 queue 20170609, David Gibson, 2017/06/09
- [Qemu-ppc] [PULL 02/20] target/ppc: fix memory leak in kvmppc_is_mem_backend_page_size_ok(), David Gibson, 2017/06/09
- [Qemu-ppc] [PULL 03/20] spapr: fix memory leak in spapr_memory_pre_plug(),
David Gibson <=
- [Qemu-ppc] [PULL 06/20] spapr: Don't misuse DR-indicator in spapr_recover_pending_dimm_state(), David Gibson, 2017/06/09
- [Qemu-ppc] [PULL 10/20] spapr: Fold spapr_phb_{add, remove}_pci_device() into their only callers, David Gibson, 2017/06/09
- [Qemu-ppc] [PULL 01/20] target/ppc: pass const string to kvmppc_is_mem_backend_page_size_ok(), David Gibson, 2017/06/09
- [Qemu-ppc] [PULL 14/20] hw/ppc/spapr: Adjust firmware name for PCI bridges, David Gibson, 2017/06/09
- [Qemu-ppc] [PULL 04/20] pseries: Correct panic behaviour for pseries machine type, David Gibson, 2017/06/09
- [Qemu-ppc] [PULL 07/20] spapr: Clean up RTAS set-indicator, David Gibson, 2017/06/09
- [Qemu-ppc] [PULL 19/20] xics: drop ICPStateClass::cpu_setup() handler, David Gibson, 2017/06/09
- [Qemu-ppc] [PULL 11/20] spapr: Rework DRC name handling, David Gibson, 2017/06/09
- [Qemu-ppc] [PULL 15/20] hw/cpu: core.c can be compiled as common object, David Gibson, 2017/06/09
- [Qemu-ppc] [PULL 08/20] spapr: Clean up handling of DR-indicator, David Gibson, 2017/06/09