]> granicus.if.org Git - php/commitdiff
MFB: fix #35740 (memory leak when including a directory)
authorAntony Dovgal <tony2001@php.net>
Tue, 20 Dec 2005 09:48:24 +0000 (09:48 +0000)
committerAntony Dovgal <tony2001@php.net>
Tue, 20 Dec 2005 09:48:24 +0000 (09:48 +0000)
main/streams/streams.c

index 4ac17dcc7fe07b05c386038147fca6c9b0f494bd..c9430fe73c28a39fb2af25b12d779e3789aa46ec 100755 (executable)
@@ -2485,6 +2485,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