qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] hw/arm/digic: Fix memory leak reported by Coverity
@ 2015-03-14 10:19 Stefan Weil
  2015-09-25 19:55 ` Stefan Weil
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Weil @ 2015-03-14 10:19 UTC (permalink / raw)
  To: QEMU Developer; +Cc: Peter Maydell, Antony Pavlov, Stefan Weil

Signed-off-by: Stefan Weil <sw@weilnetz.de>
---
 hw/arm/digic_boards.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/arm/digic_boards.c b/hw/arm/digic_boards.c
index 7114c36..ad70f7b 100644
--- a/hw/arm/digic_boards.c
+++ b/hw/arm/digic_boards.c
@@ -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);
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] hw/arm/digic: Fix memory leak reported by Coverity
  2015-03-14 10:19 [Qemu-devel] [PATCH] hw/arm/digic: Fix memory leak reported by Coverity Stefan Weil
@ 2015-09-25 19:55 ` Stefan Weil
  2015-09-25 21:54   ` Peter Maydell
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Weil @ 2015-09-25 19:55 UTC (permalink / raw)
  To: QEMU Developer; +Cc: QEMU Trivial, Peter Maydell, Antony Pavlov

Am 14.03.2015 um 11:19 schrieb Stefan Weil:
> Signed-off-by: Stefan Weil <sw@weilnetz.de>
> ---
>  hw/arm/digic_boards.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/hw/arm/digic_boards.c b/hw/arm/digic_boards.c
> index 7114c36..ad70f7b 100644
> --- a/hw/arm/digic_boards.c
> +++ b/hw/arm/digic_boards.c
> @@ -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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] hw/arm/digic: Fix memory leak reported by Coverity
  2015-09-25 19:55 ` Stefan Weil
@ 2015-09-25 21:54   ` Peter Maydell
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Maydell @ 2015-09-25 21:54 UTC (permalink / raw)
  To: Stefan Weil; +Cc: QEMU Trivial, QEMU Developer, Antony Pavlov

On 25 September 2015 at 12:55, Stefan Weil <sw@weilnetz.de> wrote:
> Am 14.03.2015 um 11:19 schrieb Stefan Weil:
>> Signed-off-by: Stefan Weil <sw@weilnetz.de>
>> ---
>>  hw/arm/digic_boards.c |    1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/hw/arm/digic_boards.c b/hw/arm/digic_boards.c
>> index 7114c36..ad70f7b 100644
>> --- a/hw/arm/digic_boards.c
>> +++ b/hw/arm/digic_boards.c
>> @@ -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.

No, this was fixed by commit 6e05a12f8f7f32a3 so although this
patch still textually applies it would introduce a double-free.

thanks
-- PMM

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-09-25 21:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-14 10:19 [Qemu-devel] [PATCH] hw/arm/digic: Fix memory leak reported by Coverity Stefan Weil
2015-09-25 19:55 ` Stefan Weil
2015-09-25 21:54   ` Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).