aboutsummaryrefslogtreecommitdiff
path: root/libiberty/argv.c
diff options
context:
space:
mode:
authorDaniel van Gerpen <daniel@vangerpen.de>2018-04-30 18:00:49 +0000
committerJeff Law <law@gcc.gnu.org>2018-04-30 12:00:49 -0600
commitd6df811e5db4d0f2cfa27c33dd97bf0ab3fe0822 (patch)
tree8f98d44087166532af97932b776aeba2fbbc6997 /libiberty/argv.c
parent98c2d5ae4623c4d8a8b9cfc49837994a5868693d (diff)
downloadgcc-d6df811e5db4d0f2cfa27c33dd97bf0ab3fe0822.zip
gcc-d6df811e5db4d0f2cfa27c33dd97bf0ab3fe0822.tar.gz
gcc-d6df811e5db4d0f2cfa27c33dd97bf0ab3fe0822.tar.bz2
argv.c (expandargv): Fix memory leak for expanded arguments.
* argv.c (expandargv): Fix memory leak for expanded arguments. From-SVN: r259775
Diffstat (limited to 'libiberty/argv.c')
-rw-r--r--libiberty/argv.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libiberty/argv.c b/libiberty/argv.c
index 4f66c89..8ead947 100644
--- a/libiberty/argv.c
+++ b/libiberty/argv.c
@@ -455,6 +455,8 @@ expandargv (int *argcp, char ***argvp)
file_argc = 0;
while (file_argv[file_argc])
++file_argc;
+ /* Free the original option's memory. */
+ free ((*argvp)[i]);
/* Now, insert FILE_ARGV into ARGV. The "+1" below handles the
NULL terminator at the end of ARGV. */
*argvp = ((char **)