com php-src: back to do_alloca(): main/main.c

From: Date: Thu, 31 Oct 2013 20:42:55 +0000
Subject: com php-src: back to do_alloca(): main/main.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-73862@lists.php.net to get a copy of this message
Commit: 39e7dcc3bbaa60a5e5cf15af1fed9a31bfb21b4f Author: Anatol Belski <ab@php.net> Thu, 31 Oct 2013 21:42:55 +0100 Parents: f1c2f8f9f17c063ac26aa5e3d0240bc6e0d07c39 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=39e7dcc3bbaa60a5e5cf15af1fed9a31bfb21b4f Log: back to do_alloca() Changed paths: M main/main.c Diff: diff --git a/main/main.c b/main/main.c index bd5e91b..f2bf878 100644 --- a/main/main.c +++ b/main/main.c @@ -2500,7 +2500,7 @@ PHPAPI int php_execute_script(zend_file_handle *primary_file TSRMLS_DC) if (old_cwd[0] != '\0') { php_ignore_value(VCWD_CHDIR(old_cwd)); } - do_alloca(old_cwd, use_heap); + free_alloca(old_cwd, use_heap); #endif return retval; } @@ -2511,10 +2511,11 @@ PHPAPI int php_execute_script(zend_file_handle *primary_file TSRMLS_DC) PHPAPI int php_execute_simple_script(zend_file_handle *primary_file, zval **ret TSRMLS_DC) { char *old_cwd; + ALLOCA_FLAG(use_heap) EG(exit_status) = 0; #define OLD_CWD_SIZE 4096 - old_cwd = emalloc(OLD_CWD_SIZE); + old_cwd = do_alloca(OLD_CWD_SIZE, use_heap); old_cwd[0] = '\0'; zend_try { @@ -2537,7 +2538,7 @@ PHPAPI int php_execute_simple_script(zend_file_handle *primary_file, zval **ret php_ignore_value(VCWD_CHDIR(old_cwd)); } - efree(old_cwd); + free_alloca(old_cwd, use_heap); return EG(exit_status); } /* }}} */

« previous php.cvs (#73862) next »