Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/gen PR/44959: Henning Petersen: glob forgets to clo...



details:   https://anonhg.NetBSD.org/src/rev/9fd0c178cc40
branches:  trunk
changeset: 764980:9fd0c178cc40
user:      christos <christos%NetBSD.org@localhost>
date:      Sat May 14 22:44:06 2011 +0000

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

diffstat:

 lib/libc/gen/glob.c |  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (37 lines):

diff -r 699fe2bfe828 -r 9fd0c178cc40 lib/libc/gen/glob.c
--- a/lib/libc/gen/glob.c       Sat May 14 22:27:58 2011 +0000
+++ b/lib/libc/gen/glob.c       Sat May 14 22:44:06 2011 +0000
@@ -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;
                }
 
                /*



Home | Main Index | Thread Index | Old Index