From 09ca61c12509bcfcf7e805064c7fbd7d97f7c4c8 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Mon, 13 Feb 2006 10:23:59 +0000 Subject: Made server wide switch for unicode on/off (according to PDM). --- main/php_variables.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'main/php_variables.c') diff --git a/main/php_variables.c b/main/php_variables.c index f59be9d86b..5d0ffa56d1 100644 --- a/main/php_variables.c +++ b/main/php_variables.c @@ -581,6 +581,7 @@ SAPI_API SAPI_TREAT_DATA_FUNC(php_default_treat_data) php_register_variable_safe(var, val, new_val_len, array_ptr TSRMLS_CC); } */ + efree(u_var); efree(u_val); } } else { @@ -696,15 +697,11 @@ static void php_build_argv(char *s, zval *track_vars_array TSRMLS_DC) } /* auto-type */ ALLOC_ZVAL(tmp); - Z_TYPE_P(tmp) = IS_STRING; - Z_STRLEN_P(tmp) = strlen(ss); - Z_STRVAL_P(tmp) = estrndup(ss, Z_STRLEN_P(tmp)); + ZVAL_RT_STRING(tmp, ss, 1); INIT_PZVAL(tmp); count++; if (zend_hash_next_index_insert(Z_ARRVAL_P(arr), &tmp, sizeof(zval *), NULL) == FAILURE) { - if (Z_TYPE_P(tmp) == IS_STRING) { - efree(Z_STRVAL_P(tmp)); - } + efree(Z_STRVAL_P(tmp)); } if (space) { *space = '+'; -- cgit v1.2.1