cvs: /php4 main.c
| From: | Andrei Zmievski | Date: | Sat, 26 Feb 2000 21:21:08 +0000 |
| Subject: | cvs: /php4 main.c | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-11057@lists.php.net to get a copy of this message | ||
andrei Sat Feb 26 13:21:08 2000 EDT
Modified files:
/php4 main.c
Log:
(php_hash_environment)
Fixed a bunch of memory leaks from the recent HTTP_*_VARS[] protection
patch.
Index: php4/main.c
diff -u php4/main.c:1.221 php4/main.c:1.222
--- php4/main.c:1.221 Sat Feb 26 10:59:29 2000
+++ php4/main.c Sat Feb 26 13:20:38 2000
@@ -19,7 +19,7 @@
*/
-/* $Id: main.c,v 1.221 2000/02/26 18:59:29 zeev Exp $ */
+/* $Id: main.c,v 1.222 2000/02/26 21:20:38 andrei Exp $ */
#include <stdio.h>
@@ -947,6 +947,8 @@
unsigned char _gpc_flags[3] = {0,0,0};
zend_bool have_variables_order;
+ PG(http_globals).post = PG(http_globals).get = PG(http_globals).cookie = PG(http_globals).server =
PG(http_globals).environment = PG(http_globals).post_files = NULL;
+
if (PG(variables_order)) {
p = PG(variables_order);
have_variables_order=1;
@@ -956,8 +958,6 @@
php_import_environment_variables(ELS_C PLS_CC);
}
- PG(http_globals).post = PG(http_globals).get = PG(http_globals).cookie = PG(http_globals).server =
PG(http_globals).environment = PG(http_globals).post_files = NULL;
-
while(*p) {
switch(*p++) {
case 'p':
@@ -991,13 +991,15 @@
break;
case 's':
case 'S':
- if (sapi_module.register_server_variables) {
- php_register_server_variables(ELS_C SLS_CC PLS_CC);
- }
+ php_register_server_variables(ELS_C SLS_CC PLS_CC);
break;
}
}
+ if (!have_variables_order) {
+ php_register_server_variables(ELS_C SLS_CC PLS_CC);
+ }
+
if (PG(http_globals).post) {
zend_hash_add_ptr(&EG(symbol_table), "HTTP_POST_VARS",
sizeof("HTTP_POST_VARS"), PG(http_globals).post, sizeof(zval *), NULL);
}
@@ -1015,10 +1017,6 @@
}
if (PG(http_globals).post_files) {
zend_hash_add_ptr(&EG(symbol_table), "HTTP_POST_FILES",
sizeof("HTTP_POST_FILES"), PG(http_globals).post_files, sizeof(zval *),NULL);
- }
-
- if (!have_variables_order) {
- php_register_server_variables(ELS_C SLS_CC PLS_CC);
}
return SUCCESS;