When the responsefile's contents are interpolated into the argument vector,
the pointer to original option string ("@filename") became lost. This
caused a small leak for every responsefile on the commandline.
---
 libiberty/argv.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libiberty/argv.c b/libiberty/argv.c
index c544dad73ee..bdd4ace4cb6 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 **) 
-- 
2.11.0

Reply via email to