From: Antony Dovgal Date: Tue, 20 Dec 2005 09:47:57 +0000 (+0000) Subject: fix #35740 (memory leak when including a directory) X-Git-Tag: php-5.1.2RC1~42 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=aec3b4e73c81684ef4d3f84bbd84dde8e5926bd9;p=php fix #35740 (memory leak when including a directory) --- diff --git a/NEWS b/NEWS index 6a79f607cd..dc0a65b672 100644 --- a/NEWS +++ b/NEWS @@ -30,6 +30,7 @@ PHP NEWS - Fixed many bugs in OCI8. (Tony) - Fixed crash and leak in mysqli when using 4.1.x client libraries and connecting to 5.x server. (Andrey) +- Fixed bug #35740 (memory leak when including a directory). (Tony) - Fixed bug #35723 (xmlrpc_introspection.c fails compile per C99 std). (Jani) - Fixed bug #35720 (A final constructor can be overwritten). (Marcus) - Fixed bug #35713 (getopt() returns array with numeric strings when passed diff --git a/main/streams/streams.c b/main/streams/streams.c index e5858619d4..6a3b3848b3 100755 --- a/main/streams/streams.c +++ b/main/streams/streams.c @@ -1831,6 +1831,10 @@ PHPAPI php_stream *_php_stream_open_wrapper_ex(char *path, char *mode, int optio if (stream == NULL && (options & REPORT_ERRORS)) { php_stream_display_wrapper_errors(wrapper, path, "failed to open stream" TSRMLS_CC); + if (opened_path && *opened_path) { + efree(*opened_path); + *opened_path = NULL; + } } php_stream_tidy_wrapper_error_log(wrapper TSRMLS_CC); #if ZEND_DEBUG