From da4cd8edb027f813242a4e1f021fc344b1b3078f Mon Sep 17 00:00:00 2001 From: Stanislav Malyshev Date: Wed, 7 May 2014 13:28:03 -0700 Subject: [PATCH] Fix memory leak in TSRM --- ext/bz2/bz2.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ext/bz2/bz2.c b/ext/bz2/bz2.c index cc845584f0..93bcaccec8 100644 --- a/ext/bz2/bz2.c +++ b/ext/bz2/bz2.c @@ -230,6 +230,9 @@ PHP_BZ2_API php_stream *_php_stream_bz2open(php_stream_wrapper *wrapper, #endif if (php_check_open_basedir(path_copy TSRMLS_CC)) { +#ifdef VIRTUAL_DIR + efree(path_copy); +#endif return NULL; } @@ -239,6 +242,9 @@ PHP_BZ2_API php_stream *_php_stream_bz2open(php_stream_wrapper *wrapper, if (opened_path && bz_file) { *opened_path = estrdup(path_copy); } +#ifdef VIRTUAL_DIR + efree(path_copy); +#endif path_copy = NULL; if (bz_file == NULL) { -- 2.50.1