OK?

2011-03-06  Michael Snyder  <msny...@vmware.com>

        * argv.c (expandargv): Close memory leak.

Index: argv.c
===================================================================
RCS file: /cvs/src/src/libiberty/argv.c,v
retrieving revision 1.22
diff -u -p -r1.22 argv.c
--- argv.c      13 Aug 2010 11:36:10 -0000      1.22
+++ argv.c      6 Mar 2011 22:41:02 -0000
@@ -439,7 +439,10 @@ expandargv (int *argcp, char ***argvp)
             due to CR/LF->CR translation when reading text files.
             That does not in-and-of itself indicate failure.  */
          && ferror (f))
-       goto error;
+       {
+         xfree (buffer);
+         goto error;
+       }
       /* Add a NUL terminator.  */
       buffer[len] = '\0';
       /* If the file is empty or contains only whitespace, buildargv would

Reply via email to