From: Dmitry Stogov Date: Wed, 25 Jun 2008 12:18:22 +0000 (+0000) Subject: Fixed bug #45352 (Segmentation fault because of tick function on second request) X-Git-Tag: php-5.2.7RC1~227 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9132607dc75e2c2d152807cfcf02e9aa6bd99e03;p=php Fixed bug #45352 (Segmentation fault because of tick function on second request) --- diff --git a/NEWS b/NEWS index a24c01d94e..9a50ed7d34 100644 --- a/NEWS +++ b/NEWS @@ -8,6 +8,8 @@ PHP NEWS functions. (Andrey) - Fixed a bug where exec() on Windows would eat the first and last double quotes (Scott) +- Fixed bug #45352 (Segmentation fault because of tick function on second + request). (Dmitry) - Fixed bug #45312 (Segmentation fault on second request for array functions). (Dmitry) - Fixed bug #45251 (double free or corruption with setAttributeNode()). (Rob) diff --git a/main/main.c b/main/main.c index 685fa9d7d3..7925626635 100644 --- a/main/main.c +++ b/main/main.c @@ -1435,6 +1435,8 @@ void php_request_shutdown(void *dummy) EG(opline_ptr) = NULL; EG(active_op_array) = NULL; + php_deactivate_ticks(TSRMLS_C); + /* 1. Call all possible shutdown functions registered with register_shutdown_function() */ if (PG(modules_activated)) zend_try { php_call_shutdown_functions(TSRMLS_C); diff --git a/main/php_ticks.c b/main/php_ticks.c index c9fa5e4e9b..ffc1dabf59 100644 --- a/main/php_ticks.c +++ b/main/php_ticks.c @@ -27,6 +27,11 @@ int php_startup_ticks(TSRMLS_D) return SUCCESS; } +void php_deactivate_ticks(TSRMLS_D) +{ + zend_llist_clean(&PG(tick_functions)); +} + void php_shutdown_ticks(TSRMLS_D) { zend_llist_destroy(&PG(tick_functions)); diff --git a/main/php_ticks.h b/main/php_ticks.h index d3d0ae1509..9dc930746f 100644 --- a/main/php_ticks.h +++ b/main/php_ticks.h @@ -22,6 +22,7 @@ #define PHP_TICKS_H int php_startup_ticks(TSRMLS_D); +void php_deactivate_ticks(TSRMLS_D); void php_shutdown_ticks(TSRMLS_D); void php_run_ticks(int count);