From: Marcus Boerger Date: Sat, 23 Nov 2002 01:17:39 +0000 (+0000) Subject: Fix memleak in debug mode X-Git-Tag: php-4.3.0RC2~35 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4c85a6c5baa2b81ef51f22461e2cec89912e56a6;p=php Fix memleak in debug mode --- diff --git a/main/streams.c b/main/streams.c index f18a783471..5bd0d50c82 100755 --- a/main/streams.c +++ b/main/streams.c @@ -2315,7 +2315,7 @@ PHPAPI php_stream *_php_stream_open_wrapper_ex(char *path, char *mode, int optio return stream; case PHP_STREAM_RELEASED: #if ZEND_DEBUG - newstream->__orig_path = copy_of_path; + newstream->__orig_path = estrdup(path); #endif return newstream; default: @@ -2337,8 +2337,9 @@ PHPAPI php_stream *_php_stream_open_wrapper_ex(char *path, char *mode, int optio } tidy_wrapper_error_log(wrapper TSRMLS_CC); #if ZEND_DEBUG - if (stream == NULL && copy_of_path != NULL) + if (stream == NULL && copy_of_path != NULL) { efree(copy_of_path); + } #endif return stream; }