[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 13/24] arm: fix memory leak
From: |
Michael Tokarev |
Subject: |
[Qemu-devel] [PULL 13/24] arm: fix memory leak |
Date: |
Thu, 19 Mar 2015 12:05:31 +0300 |
From: Gonglei <address@hidden>
Cc: Michael Tokarev <address@hidden>
Cc: Peter Maydell <address@hidden>
Signed-off-by: Gonglei <address@hidden>
Signed-off-by: Michael Tokarev <address@hidden>
---
hw/arm/digic_boards.c | 1 +
hw/arm/highbank.c | 1 +
hw/arm/vexpress.c | 3 ++-
hw/arm/virt.c | 3 ++-
4 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/hw/arm/digic_boards.c b/hw/arm/digic_boards.c
index 7114c36..e576646 100644
--- a/hw/arm/digic_boards.c
+++ b/hw/arm/digic_boards.c
@@ -113,6 +113,7 @@ static void digic_load_rom(DigicBoardState *s, hwaddr addr,
error_report("Couldn't load rom image '%s'.", filename);
exit(1);
}
+ g_free(fn);
}
}
diff --git a/hw/arm/highbank.c b/hw/arm/highbank.c
index a92cdc3..ddd10dc 100644
--- a/hw/arm/highbank.c
+++ b/hw/arm/highbank.c
@@ -282,6 +282,7 @@ static void calxeda_init(MachineState *machine, enum
cxmachines machine_id)
if (load_image_targphys("sysram.bin", 0xfff88000, filesize) < 0) {
hw_error("Unable to load %s\n", bios_name);
}
+ g_free(sysboot_filename);
} else {
hw_error("Unable to find %s\n", bios_name);
}
diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c
index 8496c16..e9a7ced 100644
--- a/hw/arm/vexpress.c
+++ b/hw/arm/vexpress.c
@@ -562,7 +562,7 @@ static void vexpress_common_init(MachineState *machine)
* If a bios file was provided, attempt to map it into memory
*/
if (bios_name) {
- const char *fn;
+ char *fn;
if (drive_get(IF_PFLASH, 0, 0)) {
error_report("The contents of the first flash device may be "
@@ -576,6 +576,7 @@ static void vexpress_common_init(MachineState *machine)
error_report("Could not load ROM image '%s'", bios_name);
exit(1);
}
+ g_free(fn);
}
/* Motherboard peripherals: the wiring is the same but the
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 9072bc2..b2eaea8 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -552,7 +552,7 @@ static void create_flash(const VirtBoardInfo *vbi)
char *nodename;
if (bios_name) {
- const char *fn;
+ char *fn;
if (drive_get(IF_PFLASH, 0, 0)) {
error_report("The contents of the first flash device may be "
@@ -565,6 +565,7 @@ static void create_flash(const VirtBoardInfo *vbi)
error_report("Could not load ROM image '%s'", bios_name);
exit(1);
}
+ g_free(fn);
}
create_one_flash("virt.flash0", flashbase, flashsize);
--
2.1.4
- [Qemu-devel] [PULL 08/24] Fix remaining warnings from Sparse (void return), (continued)
- [Qemu-devel] [PULL 08/24] Fix remaining warnings from Sparse (void return), Michael Tokarev, 2015/03/19
- [Qemu-devel] [PULL 06/24] target-mips: Fix warning from Sparse, Michael Tokarev, 2015/03/19
- [Qemu-devel] [PULL 01/24] cris: remove unused cris_cond15 declarations, Michael Tokarev, 2015/03/19
- [Qemu-devel] [PULL 10/24] target-moxie: Fix warnings from Sparse (one-bit signed bitfield), Michael Tokarev, 2015/03/19
- [Qemu-devel] [PULL 19/24] qtest/ahci: Fix a bit mask expression, Michael Tokarev, 2015/03/19
- [Qemu-devel] [PULL 05/24] arm/nseries: Fix warnings from Sparse, Michael Tokarev, 2015/03/19
- [Qemu-devel] [PULL 22/24] elf-loader: Fix truncation warning from coverity, Michael Tokarev, 2015/03/19
- [Qemu-devel] [PULL 02/24] backends: Fix warning from Sparse, Michael Tokarev, 2015/03/19
- [Qemu-devel] [PULL 17/24] smbios: add max speed comdline option for type-17 (meory device) structure, Michael Tokarev, 2015/03/19
- [Qemu-devel] [PULL 04/24] omap: Fix warnings from Sparse, Michael Tokarev, 2015/03/19
- [Qemu-devel] [PULL 13/24] arm: fix memory leak,
Michael Tokarev <=
- [Qemu-devel] [PULL 23/24] elf-loader: Add missing error handling for call of lseek, Michael Tokarev, 2015/03/19
- [Qemu-devel] [PULL 11/24] hmp: Fix definition of command quit, Michael Tokarev, 2015/03/19
- Re: [Qemu-devel] [PULL 00/24] Trivial patches for 2015-03-19, Peter Maydell, 2015/03/19