Module Name:    src
Committed By:   christos
Date:           Thu Nov 14 01:12:14 UTC 2013

Modified Files:
        src/external/gpl3/binutils/dist/ld/emultempl: elf32.em

Log Message:
CID 1102856: Fix memory leak


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 \
    src/external/gpl3/binutils/dist/ld/emultempl/elf32.em

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/binutils/dist/ld/emultempl/elf32.em
diff -u src/external/gpl3/binutils/dist/ld/emultempl/elf32.em:1.8 src/external/gpl3/binutils/dist/ld/emultempl/elf32.em:1.9
--- src/external/gpl3/binutils/dist/ld/emultempl/elf32.em:1.8	Fri Oct 25 10:28:28 2013
+++ src/external/gpl3/binutils/dist/ld/emultempl/elf32.em	Wed Nov 13 20:12:14 2013
@@ -1531,7 +1531,8 @@ gld${EMULATION_NAME}_before_allocation (
 	   a dep audit entry.  */
 	if (audit_libs && *audit_libs != '\0')
 	  {
-	    char *cp = xstrdup (audit_libs);
+	    char *cp, *fcp;
+	    fcp = cp = xstrdup (audit_libs);
 	    do
 	      {
 		int more = 0;
@@ -1549,6 +1550,7 @@ gld${EMULATION_NAME}_before_allocation (
 		cp = more ? ++cp2 : NULL;
 	      }
 	    while (cp != NULL);
+	    free (fcp);
 	  }
       }
 

Reply via email to