qemu-trivial
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-trivial] [PATCH v2] e500: fix memory leak


From: Michael Tokarev
Subject: Re: [Qemu-trivial] [PATCH v2] e500: fix memory leak
Date: Sat, 28 Feb 2015 13:47:52 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.4.0

28.02.2015 13:18, Gonglei wrote:
> On 2015/2/28 18:13, Michael Tokarev wrote:
[]
>> How about this?
>>
> It's ok on function, but seems oddly, isn't it?

I don't see anything odd in it.  The `filename' variable is only
used as an argument for load_device_tree() function and is not used
anywhwere else, so it's logical to free it after use.

>> --- a/hw/ppc/e500.c
>> +++ b/hw/ppc/e500.c
>> @@ -308,6 +308,7 @@ static int ppce500_load_device_tree(MachineState 
>> *machine,
>>          }
>>
>>          fdt = load_device_tree(filename, &fdt_size);
>> +        g_free(filename);
>>          if (!fdt) {
>>              goto out;
>>          }
>>
Thanks,

/mjt




reply via email to

[Prev in Thread] Current Thread [Next in Thread]