From 4c85a6c5baa2b81ef51f22461e2cec89912e56a6 Mon Sep 17 00:00:00 2001 From: Marcus Boerger Date: Sat, 23 Nov 2002 01:17:39 +0000 Subject: [PATCH] Fix memleak in debug mode --- main/streams.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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; } -- 2.40.0