[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 036/126] hw/nubus/nubus-device: Fix memory leak in nubus_device_re
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 036/126] hw/nubus/nubus-device: Fix memory leak in nubus_device_realize |
Date: |
Mon, 27 Feb 2023 15:00:43 +0100 |
From: Mauro Matteo Cascella <mcascell@redhat.com>
Local variable "name" is allocated through strdup_printf and should be
freed with g_free() to avoid memory leak.
Fixes: 3616f424 ("nubus-device: add romfile property for loading declaration
ROMs")
Signed-off-by: Mauro Matteo Cascella <mcascell@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20221222172915.671597-1-mcascell@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/nubus/nubus-device.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/nubus/nubus-device.c b/hw/nubus/nubus-device.c
index 0f1852f671..49008e4938 100644
--- a/hw/nubus/nubus-device.c
+++ b/hw/nubus/nubus-device.c
@@ -80,6 +80,7 @@ static void nubus_device_realize(DeviceState *dev, Error
**errp)
&error_abort);
ret = load_image_mr(path, &nd->decl_rom);
g_free(path);
+ g_free(name);
if (ret < 0) {
error_setg(errp, "could not load romfile \"%s\"", nd->romfile);
return;
--
2.38.1
- [PULL 026/126] tcg/tcg-op-gvec: Remove unused "qemu/main-loop.h" header, (continued)
- [PULL 026/126] tcg/tcg-op-gvec: Remove unused "qemu/main-loop.h" header, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 027/126] accel/tcg: Restrict 'qapi-commands-machine.h' to system emulation, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 030/126] sysemu/kvm: Remove CONFIG_USER_ONLY guard, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 029/126] accel/kvm: Silent -Wmissing-field-initializers warning, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 028/126] accel/xen: Remove dead code, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 031/126] replay: Extract core API to 'exec/replay-core.h', Philippe Mathieu-Daudé, 2023/02/27
- [PULL 032/126] tests/unit: Restrict machine-smp.c test to system emulation, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 033/126] softmmu: Silent -Wmissing-field-initializers warning, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 035/126] qemu/typedefs: Sort in case-insensitive alphabetical order (again), Philippe Mathieu-Daudé, 2023/02/27
- [PULL 034/126] softmmu: Extract watchpoint API from physmem.c, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 036/126] hw/nubus/nubus-device: Fix memory leak in nubus_device_realize,
Philippe Mathieu-Daudé <=
- [PULL 037/126] hw/qdev: Constify DeviceState* argument of qdev_get_parent_bus(), Philippe Mathieu-Daudé, 2023/02/27
- [PULL 038/126] hw/cpu: Extend CPUState::cluster_index documentation, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 039/126] hw/i386/x86: Reduce init_topo_info() scope, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 040/126] hw/i386/ich9: Rename Q35_MASK to ICH9_MASK, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 041/126] hw/isa/lpc_ich9: Unexport PIRQ functions, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 042/126] hw/isa/lpc_ich9: Eliminate ICH9LPCState::isa_bus, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 043/126] hw/i2c/smbus_ich9: Move ich9_smb_set_irq() in front of ich9_smbus_realize(), Philippe Mathieu-Daudé, 2023/02/27
- [PULL 044/126] hw/i2c/smbus_ich9: Inline ich9_smb_init() and remove it, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 045/126] hw/i386/pc_q35: Allow for setting properties before realizing TYPE_ICH9_LPC_DEVICE, Philippe Mathieu-Daudé, 2023/02/27
- [PULL 047/126] hw/isa/lpc_ich9: Remove redundant ich9_lpc_reset() invocation, Philippe Mathieu-Daudé, 2023/02/27