]> granicus.if.org Git - php/commitdiff
Fixed bug #25127 (reset memory_limit before terminating the request)
authorIlia Alshanetsky <iliaa@php.net>
Fri, 22 Aug 2003 20:01:53 +0000 (20:01 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Fri, 22 Aug 2003 20:01:53 +0000 (20:01 +0000)
main/main.c

index 9ddd26f81af61db2b0cba75b1eee2b85fbe8c6f2..c7cf42b12fe280fb3604274dc47b78b2a50e7219 100644 (file)
@@ -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;