From: Andi Gutmans Date: Sun, 29 Apr 2001 18:06:56 +0000 (+0000) Subject: - Remove leak from opendir() under Windows. Maybe readdir.c should be X-Git-Tag: php-4.0.6RC1~258 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=91451bfcaffaeb7dec69ed009b5a01b08d4ce13c;p=php - Remove leak from opendir() under Windows. Maybe readdir.c should be changed to use emalloc() PR: Submitted by: Reviewed by: Obtained from: --- diff --git a/ext/standard/dir.c b/ext/standard/dir.c index e00569fe28..fcb1ea7543 100644 --- a/ext/standard/dir.c +++ b/ext/standard/dir.c @@ -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