]> granicus.if.org Git - php/commitdiff
- Remove leak from opendir() under Windows. Maybe readdir.c should be
authorAndi Gutmans <andi@php.net>
Sun, 29 Apr 2001 18:06:56 +0000 (18:06 +0000)
committerAndi Gutmans <andi@php.net>
Sun, 29 Apr 2001 18:06:56 +0000 (18:06 +0000)
  changed to use emalloc()
PR:
Submitted by:
Reviewed by:
Obtained from:

ext/standard/dir.c

index e00569fe287e9511fd1ca08c76d88a021b408f3d..fcb1ea75430c436d4f7fabd010b3565790514f86 100644 (file)
@@ -170,6 +170,9 @@ static void _php_do_opendir(INTERNAL_FUNCTION_PARAMETERS, int createobject)
 
 #ifdef PHP_WIN32
        if (!dirp->dir || dirp->dir->finished) {
+               if (dirp->dir) {
+                       closedir(dirp->dir);
+               }
 #else
        if (!dirp->dir) {
 #endif