]> granicus.if.org Git - php/commitdiff
- Implemented this like the comment says, otherwise it will ofcourse modify
authorDerick Rethans <derick@php.net>
Wed, 26 Oct 2005 13:20:52 +0000 (13:20 +0000)
committerDerick Rethans <derick@php.net>
Wed, 26 Oct 2005 13:20:52 +0000 (13:20 +0000)
  both instances of this variable name...

ext/filter/filter.c

index eb8213287908bbfdedb2a730c4f3f8b861c9e680..11e88f86ee3778c28106a8c8e7fbabd498920292 100644 (file)
@@ -326,7 +326,7 @@ static unsigned int php_sapi_filter(int arg, char *var, char **val, unsigned int
 
        /* Make a copy of the variable name, as php_register_variable_ex seems to
         * modify it */
-       orig_var = var;
+       orig_var = estrdup(var);
 
        /* Store the RAW variable internally */
        /* FIXME: Should not use php_register_variable_ex as that also registers
@@ -351,6 +351,7 @@ static unsigned int php_sapi_filter(int arg, char *var, char **val, unsigned int
        }
 
        php_register_variable_ex(orig_var, &new_var, orig_array_ptr TSRMLS_CC);
+       efree(orig_var);
 
        if (new_val_len) {
                *new_val_len = out_len;