about summary refs log tree commit diff
path: root/sysdeps/generic/glob.c
diff options
context:
space:
mode:
authorAndreas Jaeger <aj@suse.de>2000-07-13 12:12:01 +0000
committerAndreas Jaeger <aj@suse.de>2000-07-13 12:12:01 +0000
commit1338451ba27ed2519cf1d563fb0900bf660c2230 (patch)
tree5826332b29e1b17c471e0e6b3624a96c9f4b2827 /sysdeps/generic/glob.c
parente940b742ded9d3a496ef21d67f1c9c0c019d3877 (diff)
downloadglibc-1338451ba27ed2519cf1d563fb0900bf660c2230.tar.gz
glibc-1338451ba27ed2519cf1d563fb0900bf660c2230.tar.xz
glibc-1338451ba27ed2519cf1d563fb0900bf660c2230.zip
Update.
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.
Diffstat (limited to 'sysdeps/generic/glob.c')
-rw-r--r--sysdeps/generic/glob.c6
1 files changed, 4 insertions, 2 deletions
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);