Re: [PATCH v2 2/2] btrfs-progs: Fix up memory leakage

2012-09-26 Thread Goffredo Baroncelli
On 09/25/2012 07:14 PM, Goffredo Baroncelli wrote: I strongly disagree with this approach. The callee often don't know what happen after and before the call. The same is true for the programmer, because the code is quite often updated by several people. A clean exit() is the right thing to do as

Re: [PATCH v2 2/2] btrfs-progs: Fix up memory leakage

2012-09-25 Thread Zhi Yong Wu
On Wed, Sep 26, 2012 at 1:14 AM, Goffredo Baroncelli wrote: > On 09/25/2012 12:14 PM, David Sterba wrote: >> >> On Tue, Sep 25, 2012 at 10:02:16AM +0800, zwu.ker...@gmail.com wrote: >>> >>> From: Zhi Yong Wu >>> >>>Some code pathes forget to free memory on exit. >> >> >> Same as with the fd's,

Re: [PATCH v2 2/2] btrfs-progs: Fix up memory leakage

2012-09-25 Thread Goffredo Baroncelli
On 09/25/2012 12:14 PM, David Sterba wrote: On Tue, Sep 25, 2012 at 10:02:16AM +0800, zwu.ker...@gmail.com wrote: From: Zhi Yong Wu Some code pathes forget to free memory on exit. Same as with the fd's, kernel will free all memory for us at exit(). I strongly disagree with this approach.

Re: [PATCH v2 2/2] btrfs-progs: Fix up memory leakage

2012-09-25 Thread Zhi Yong Wu
On Tue, Sep 25, 2012 at 6:14 PM, David Sterba wrote: > On Tue, Sep 25, 2012 at 10:02:16AM +0800, zwu.ker...@gmail.com wrote: >> From: Zhi Yong Wu >> >> Some code pathes forget to free memory on exit. > > Same as with the fd's, kernel will free all memory for us at exit(). hi, can you let me kno

Re: [PATCH v2 2/2] btrfs-progs: Fix up memory leakage

2012-09-25 Thread David Sterba
On Tue, Sep 25, 2012 at 10:02:16AM +0800, zwu.ker...@gmail.com wrote: > From: Zhi Yong Wu > > Some code pathes forget to free memory on exit. Same as with the fd's, kernel will free all memory for us at exit(). If there's lots of memory allocated, it may be even faster to leave the unallocati

[PATCH v2 2/2] btrfs-progs: Fix up memory leakage

2012-09-24 Thread zwu . kernel
From: Zhi Yong Wu Some code pathes forget to free memory on exit. Changelog from v1: Fix the variable is used uncorrectly. [Ram Pai] Signed-off-by: Zhi Yong Wu --- cmds-filesystem.c |6 -- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cmds-filesystem.c b/cmds-file

[PATCH v2 2/2] btrfs-progs: Fix up memory leakage

2012-09-05 Thread Zhi Yong Wu
Some code pathes forget to free memory on exit. Changelog from v1: Fix the variable is used uncorrectly. [Ram Pai] Signed-off-by: Zhi Yong Wu --- cmds-filesystem.c |6 -- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cmds-filesystem.c b/cmds-filesystem.c index e62c4