about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--sysdeps/generic/glob.c6
2 files changed, 10 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 1a81926e6f..057435a9c8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2000-07-13  Andreas Schwab  <schwab@suse.de>
+
+	* sysdeps/generic/glob.c (glob): Fix memory leak.
+	[SHELL]: Remove reference to undefined variable `files'.
+	Fixes PR libc/1782.
+
 2000-07-13  Andreas Jaeger  <aj@suse.de>
 
 	* sysdeps/unix/sysv/linux/mips/Versions: Add libgcc frame handling
diff --git a/sysdeps/generic/glob.c b/sysdeps/generic/glob.c
index 6098766ca0..2de01337c2 100644
--- a/sysdeps/generic/glob.c
+++ b/sysdeps/generic/glob.c
@@ -896,7 +896,6 @@ glob (pattern, flags, errfunc, pglob)
 	    if (interrupt_state)
 	      {
 		globfree (&dirs);
-		globfree (&files);
 		return GLOB_ABORTED;
 	      }
 	  }
@@ -1007,7 +1006,10 @@ glob (pattern, flags, errfunc, pglob)
 		pglob->gl_pathv = new_pathv;
 	    }
 	  else
-	    return GLOB_NOMATCH;
+	    {
+	      globfree (&dirs);
+	      return GLOB_NOMATCH;
+	    }
 	}
 
       globfree (&dirs);