This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[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: dj at redhat dot com, ian at airs dot com
- Cc: binutils at sourceware dot org, gcc-patches List <gcc-patches at gcc dot gnu dot org>, Jeff Law <law at redhat dot com>
- Date: Wed, 28 Jan 2015 19:34:38 +0800
- Subject: [PATCH] libiberty/argv.c: Use freeargv() instead of free() to avoid memory leak.
- Authentication-results: sourceware.org; auth=none
Need free each array elements, or may cause memory leak.
2015-01-28 Chen Gang <gang.chen.5i5j@gmail.com>
* argv.c (expandargv): Use freeargv() instead of free() to avoid
memory leak.
---
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);
free (buffer);
/* Rescan all of the arguments just read to support response
files that include other response files. */
--
1.9.3 (Apple Git-50)