This is the mail archive of the
mailing list for the binutils project.
Re: [PATCH] libiberty/argv.c: Use freeargv() instead of free() to avoid memory leak.
- From: Chen Gang S <gang dot chen at sunrus dot com dot cn>
- To: Andrew Burgess <andrew dot burgess at embecosm dot com>
- Cc: dj at redhat dot com, ian at airs dot com, binutils at sourceware dot org, gcc-patches List <gcc-patches at gcc dot gnu dot org>, Jeff Law <law at redhat dot com>
- Date: Thu, 29 Jan 2015 05:51:03 +0800
- Subject: Re: [PATCH] libiberty/argv.c: Use freeargv() instead of free() to avoid memory leak.
- Authentication-results: sourceware.org; auth=none
- References: <54C8C94E dot 9030305 at sunrus dot com dot cn> <20150128120219 dot GA5978 at embecosm dot com>
On 1/28/15 20:02, Andrew Burgess wrote:
> * Chen Gang S <email@example.com> [2015-01-28 19:34:38 +0800]:
>> libiberty/argv.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>> diff --git a/libiberty/argv.c b/libiberty/argv.c
>> index f2727e8..9fdd55b 100644
>> --- a/libiberty/argv.c
>> +++ b/libiberty/argv.c
>> @@ -454,7 +454,7 @@ expandargv (int *argcp, char ***argvp)
>> /* Free up memory allocated to process the response file. We do
>> not use freeargv because the individual options in FILE_ARGV
>> are now in the main ARGV. */
>> - free (file_argv);
>> + freeargv (file_argv);
> I'm not commenting on the correctness of the patch, however, you will
> need to update the comment just above this change.
> Personally, I'd also hope that the commit message explains why the
> comment is no longer correct, rather than just stating that the change
> has been made.
Oh, really. Excuse me, originally I did not notice about it. I shall
send patch v2 for it (just like what DJ Delorie said in another reply).
Open, share, and attitude like air, water, and life which God blessed