]> granicus.if.org Git - php/commitdiff
Fix memory leak in TSRM
authorStanislav Malyshev <stas@php.net>
Wed, 7 May 2014 20:28:03 +0000 (13:28 -0700)
committerStanislav Malyshev <stas@php.net>
Wed, 7 May 2014 20:28:03 +0000 (13:28 -0700)
ext/bz2/bz2.c

index cc845584f0277e84325f33abfc62add49ac46c32..93bcaccec86d3662ab04ee866d5812d9426224da 100644 (file)
@@ -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) {