diff options
author | Ilia Alshanetsky <iliaa@php.net> | 2003-08-22 20:01:53 +0000 |
---|---|---|
committer | Ilia Alshanetsky <iliaa@php.net> | 2003-08-22 20:01:53 +0000 |
commit | d52172ad890b7e8f117a05da127360c30e3dbbb5 (patch) | |
tree | f52c200ff585e148695e95dc00a9f556555115bd | |
parent | f94b536bc8726b05887d9a48bb835a7f8e301c38 (diff) | |
download | php-git-d52172ad890b7e8f117a05da127360c30e3dbbb5.tar.gz |
Fixed bug #25127 (reset memory_limit before terminating the request)
-rw-r--r-- | main/main.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/main/main.c b/main/main.c index 9ddd26f81a..c7cf42b12f 100644 --- a/main/main.c +++ b/main/main.c @@ -116,14 +116,12 @@ static PHP_INI_MH(OnSetPrecision) */ static PHP_INI_MH(OnChangeMemoryLimit) { - int new_limit; - if (new_value) { - new_limit = zend_atoi(new_value, new_value_length); + PG(memory_limit) = zend_atoi(new_value, new_value_length); } else { - new_limit = 1<<30; /* effectively, no limit */ + PG(memory_limit) = 1<<30; /* effectively, no limit */ } - return zend_set_memory_limit(new_limit); + return zend_set_memory_limit(PG(memory_limit)); } /* }}} */ #endif @@ -741,6 +739,10 @@ static void php_error_cb(int type, const char *error_filename, const uint error_ case E_USER_ERROR: EG(exit_status) = 255; if (module_initialized) { +#if MEMORY_LIMIT + /* restore memory limit */ + AG(memory_limit) = PG(memory_limit); +#endif zend_bailout(); efree(buffer); return; |