Module Name:    src
Committed By:   christos
Date:           Sat May 14 22:44:06 UTC 2011

Modified Files:
        src/lib/libc/gen: glob.c

Log Message:
PR/44959: Henning Petersen: glob forgets to closedir on out of space condition.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/lib/libc/gen/glob.c

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

Modified files:

Index: src/lib/libc/gen/glob.c
diff -u src/lib/libc/gen/glob.c:1.29 src/lib/libc/gen/glob.c:1.30
--- src/lib/libc/gen/glob.c:1.29	Sat Jan 22 11:24:44 2011
+++ src/lib/libc/gen/glob.c	Sat May 14 18:44:06 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: glob.c,v 1.29 2011/01/22 16:24:44 christos Exp $	*/
+/*	$NetBSD: glob.c,v 1.30 2011/05/14 22:44:06 christos Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)glob.c	8.3 (Berkeley) 10/13/93";
 #else
-__RCSID("$NetBSD: glob.c,v 1.29 2011/01/22 16:24:44 christos Exp $");
+__RCSID("$NetBSD: glob.c,v 1.30 2011/05/14 22:44:06 christos Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -789,7 +789,7 @@
 	if (pglob->gl_flags & GLOB_ALTDIRFUNC)
 		readdirfunc = pglob->gl_readdir;
 	else
-		readdirfunc = (struct dirent *(*)__P((void *))) readdir;
+		readdirfunc = (struct dirent *(*)(void *)) readdir;
 	while ((dp = (*readdirfunc)(dirp)) != NULL) {
 		u_char *sc;
 		Char *dc;
@@ -799,7 +799,8 @@
 			errno = 0;
 			*pathend++ = SEP;
 			*pathend = EOS;
-			return GLOB_NOSPACE;
+			error = GLOB_NOSPACE;
+			break;
 		}
 
 		/*

Reply via email to