[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 55/79] spapr: fix memory leak in spapr_memory_pre_pl
From: |
Michael Roth |
Subject: |
[Qemu-devel] [PATCH 55/79] spapr: fix memory leak in spapr_memory_pre_plug() |
Date: |
Mon, 28 Aug 2017 19:14:30 -0500 |
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>
(cherry picked from commit 8a9e0e7b890b2598da94646bf6a7272f3d3924de)
Signed-off-by: Michael Roth <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 5564f78..58c15ef 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -2547,8 +2547,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);
}
typedef struct sPAPRDIMMState {
--
2.7.4
- [Qemu-devel] [PATCH 35/79] e1000e: Fix ICR "Other" causes clear logic, (continued)
- [Qemu-devel] [PATCH 35/79] e1000e: Fix ICR "Other" causes clear logic, Michael Roth, 2017/08/28
- [Qemu-devel] [PATCH 33/79] virtio: allow broken device to notify guest, Michael Roth, 2017/08/28
- [Qemu-devel] [PATCH 31/79] stream: fix crash in stream_start() when block_job_create() fails, Michael Roth, 2017/08/28
- [Qemu-devel] [PATCH 46/79] mirror: Drop permissions on s->target on completion, Michael Roth, 2017/08/28
- [Qemu-devel] [PATCH 36/79] s390x/css: catch section mismatch on load, Michael Roth, 2017/08/28
- [Qemu-devel] [PATCH 43/79] tests: Add coverage for recent block geometry fixes, Michael Roth, 2017/08/28
- [Qemu-devel] [PATCH 41/79] blkdebug: Simplify override logic, Michael Roth, 2017/08/28
- [Qemu-devel] [PATCH 44/79] block: Simplify BDRV_BLOCK_RAW recursion, Michael Roth, 2017/08/28
- [Qemu-devel] [PATCH 49/79] tests: check-qom-proplist: add checks for cmdline-created objects, Michael Roth, 2017/08/28
- [Qemu-devel] [PATCH 53/79] target/ppc: fix memory leak in kvmppc_is_mem_backend_page_size_ok(), Michael Roth, 2017/08/28
- [Qemu-devel] [PATCH 55/79] spapr: fix memory leak in spapr_memory_pre_plug(),
Michael Roth <=
- [Qemu-devel] [PATCH 37/79] virtio-net: fix wild pointer when remove virtio-net queues, Michael Roth, 2017/08/28
- [Qemu-devel] [PATCH 38/79] blkdebug: Sanity check block layer guarantees, Michael Roth, 2017/08/28
- [Qemu-devel] [PATCH 52/79] target/ppc: pass const string to kvmppc_is_mem_backend_page_size_ok(), Michael Roth, 2017/08/28
- [Qemu-devel] [PATCH 54/79] spapr: add pre_plug function for memory, Michael Roth, 2017/08/28
- [Qemu-devel] [PATCH 48/79] linuxboot_dma: compile for i486, Michael Roth, 2017/08/28
- [Qemu-devel] [PATCH 51/79] pc: Use "min-[x]level" on compat_props, Michael Roth, 2017/08/28
- [Qemu-devel] [PATCH 58/79] nbd: Fully initialize client in case of failed negotiation, Michael Roth, 2017/08/28
- [Qemu-devel] [PATCH 63/79] nbd: fix NBD over TLS, Michael Roth, 2017/08/28
- [Qemu-devel] [PATCH 61/79] blkdebug: Catch bs->exact_filename overflow, Michael Roth, 2017/08/28
- [Qemu-devel] [PATCH 42/79] blkdebug: Add ability to override unmap geometries, Michael Roth, 2017/08/28