diff options
author | Zeev Suraski <zeev@php.net> | 2000-02-15 22:51:18 +0000 |
---|---|---|
committer | Zeev Suraski <zeev@php.net> | 2000-02-15 22:51:18 +0000 |
commit | 4a211a80fb5702c5524c0db6e67a04d1a4156dc1 (patch) | |
tree | 998b7beb62f7f718452de7b8613f551367239e82 /main/php_variables.c | |
parent | ea459657d111f82f254ee6133608b79b126973cd (diff) | |
download | php-git-4a211a80fb5702c5524c0db6e67a04d1a4156dc1.tar.gz |
@- Fixed RFC1867 file upload under Windows (Zeev)
Fixed a memory leak
Diffstat (limited to 'main/php_variables.c')
-rw-r--r-- | main/php_variables.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/main/php_variables.c b/main/php_variables.c index 8f02d0c541..842b5d47eb 100644 --- a/main/php_variables.c +++ b/main/php_variables.c @@ -192,7 +192,18 @@ void php_treat_data(int arg, char *str ELS_DC PLS_DC SLS_DC) INIT_PZVAL(array_ptr); switch (arg) { case PARSE_POST: - zend_hash_add_ptr(&EG(symbol_table), "HTTP_POST_VARS", sizeof("HTTP_POST_VARS"), array_ptr, sizeof(pval *),NULL); + if (zend_hash_add_ptr(&EG(symbol_table), "HTTP_POST_VARS", sizeof("HTTP_POST_VARS"), array_ptr, sizeof(pval *),NULL)==FAILURE) { + zval **p; + + /* This could happen if we're in RFC 1867 file upload */ + /* The parsing portion of the POST reader should actually move + * to this function - Zeev + */ + zval_dtor(array_ptr); + FREE_ZVAL(array_ptr); + zend_hash_find(&EG(symbol_table), "HTTP_POST_VARS", sizeof("HTTP_POST_VARS"), (void **) &p); + array_ptr = *p; + } break; case PARSE_GET: zend_hash_add_ptr(&EG(symbol_table), "HTTP_GET_VARS", sizeof("HTTP_GET_VARS"), array_ptr, sizeof(pval *),NULL); |