[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 03/20] spapr: fix memory leak in spapr_memory_pre_plu
From: |
David Gibson |
Subject: |
[Qemu-devel] [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-devel] [PULL 00/20] ppc-for-2.10 queue 20170609, David Gibson, 2017/06/09
- [Qemu-devel] [PULL 02/20] target/ppc: fix memory leak in kvmppc_is_mem_backend_page_size_ok(), David Gibson, 2017/06/09
- [Qemu-devel] [PULL 03/20] spapr: fix memory leak in spapr_memory_pre_plug(),
David Gibson <=
- [Qemu-devel] [PULL 05/20] spapr: Clean up DR entity sense handling, David Gibson, 2017/06/09
- [Qemu-devel] [PULL 04/20] pseries: Correct panic behaviour for pseries machine type, David Gibson, 2017/06/09
- [Qemu-devel] [PULL 01/20] target/ppc: pass const string to kvmppc_is_mem_backend_page_size_ok(), David Gibson, 2017/06/09
- [Qemu-devel] [PULL 06/20] spapr: Don't misuse DR-indicator in spapr_recover_pending_dimm_state(), David Gibson, 2017/06/09
- [Qemu-devel] [PULL 12/20] pnv_core: drop reference on ICPState object during CPU realization, David Gibson, 2017/06/09
- [Qemu-devel] [PULL 10/20] spapr: Fold spapr_phb_{add, remove}_pci_device() into their only callers, David Gibson, 2017/06/09
- [Qemu-devel] [PULL 07/20] spapr: Clean up RTAS set-indicator, David Gibson, 2017/06/09
- [Qemu-devel] [PULL 15/20] hw/cpu: core.c can be compiled as common object, David Gibson, 2017/06/09
- [Qemu-devel] [PULL 18/20] xics: setup cpu at realize time, David Gibson, 2017/06/09
- [Qemu-devel] [PULL 13/20] xics: add reset() handler to ICPStateClass, David Gibson, 2017/06/09