hw/arm/digic: Fix memory leak reported by Coverity
PATCH 1/1 hw/arm/digic: Fix memory leak reported by Coverity
Signed-off-by Stefan Weil <[email protected]>
--- hw/arm/digic_boards.c | 1 + 1 file changed, 1 insertion(+)
hw/arm/digic_boards.c +1 -0
@@ -109,6 +109,7 @@ static void digic_load_rom(DigicBoardState *s, hwaddr addr, } rom_size =load_image_targphys (fn, addr, max_size); +g_free (fn);if (rom_size <0 || rom_size > max_size) {error_report ("Couldn't load rom image '%s'." , filename);exit (1 );
Signature · 1 line
1.7.10.4
Am 14.03.2015 um 11:19 schrieb Stefan Weil:
Quoted 11 lines
Signed-off-by Stefan Weil <[email protected]>--- hw/arm/digic_boards.c | 1 + 1 file changed, 1 insertion(+)hw/arm/digic_boards.c +0
-0
hw/arm/digic_boards.c static void digic_load_rom(DigicBoardState *s, hwaddr addr, · line 115
Quoted 7 lines
hw/arm/digic_boards.c +1
-0@@ -109,6 +109,7 @@ static void digic_load_rom(DigicBoardState *s, hwaddr addr, } rom_size =load_image_targphys (fn, addr, max_size); +g_free (fn);if (rom_size <0 || rom_size > max_size) {error_report ("Couldn't load rom image '%s'." , filename);exit (1 );
Ping? Maybe this old patch can be applied to qemu-trivial.
fn = qemu_find_file() allocates memory, so g_free is needed.
Regards
Stefan
Quoted 22 lines · Stefan Weil
Am 14.03.2015 um 11:19 schrieb Stefan Weil:
Quoted 11 lines
Signed-off-by Stefan Weil <[email protected]>--- hw/arm/digic_boards.c | 1 + 1 file changed, 1 insertion(+)hw/arm/digic_boards.c +0
-0hw/arm/digic_boards.c static void digic_load_rom(DigicBoardState *s, hwaddr addr, · line 115
Quoted 7 lines
hw/arm/digic_boards.c +1
-0@@ -109,6 +109,7 @@ static void digic_load_rom(DigicBoardState *s, hwaddr addr, } rom_size =load_image_targphys (fn, addr, max_size); +g_free (fn);if (rom_size <0 || rom_size > max_size) {error_report ("Couldn't load rom image '%s'." , filename);exit (1 );Ping? Maybe this old patch can be applied to qemu-trivial.
Quoted 1 line
fn =
qemu_find_file()allocates memory, sog_freeis needed.
No, this was fixed by commit 6e05a12f8f7f32a3 so although this patch still textually applies it would introduce a double-free.
thanks
-- PMM