qemu-trivial
[Top][All Lists]
Advanced

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

Re: [Qemu-trivial] [PATCH] dump.c: Fix memory leak issue in cleanup proc


From: Chen Gang
Subject: Re: [Qemu-trivial] [PATCH] dump.c: Fix memory leak issue in cleanup processing for dump_init()
Date: Fri, 15 Aug 2014 06:03:16 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7

On 08/15/2014 04:49 AM, Luiz Capitulino wrote:
> On Sun, 03 Aug 2014 23:28:56 +0800
> Chen Gang <address@hidden> wrote:
> 
>> > In dump_init(), when failure occurs, need notice about 'fd' and memory
>> > mapping. So call dump_cleanup() for it (need let all initializations at
>> > front).
>> > 
>> > Also simplify dump_cleanup(): remove redundant 'ret' and redundant 'fd'
>> > checking.
>> > 
>> > Signed-off-by: Chen Gang <address@hidden>
> Applied to the qmp branch, thanks.
> 

Thanks.

> PS: I still find it hard to track the file-descriptor's life time. IMO,
>     the best would be to always release it where it's allocated which is
>     qmp_dump_guest_memory().
> 

If it is really hard to track, for me, I prefer to let dump_cleanup()
common enough, so can simplify every members thinking.

When use genric *_cleanup(), it means the resource manage management is
a little complex, need use a generic cleanup function for it to be sure
that every thing is not missed, and always save enough.


Thanks.
-- 
Chen Gang

Open share and attitude like air water and life which God blessed



reply via email to

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