]> granicus.if.org Git - php/commitdiff
Free string before overwriting it
authorSascha Schumann <sas@php.net>
Sat, 4 May 2002 19:06:46 +0000 (19:06 +0000)
committerSascha Schumann <sas@php.net>
Sat, 4 May 2002 19:06:46 +0000 (19:06 +0000)
main/output.c

index c8d414910adfdb9e3692fa52fae020bd4d6a1129..24b985ba6cc2a081017161408a3a09146324c63f 100644 (file)
@@ -324,8 +324,10 @@ PHPAPI void php_ob_set_internal_handler(php_output_handler_func_t internal_outpu
        OG(active_ob_buffer).internal_output_handler = internal_output_handler;
        OG(active_ob_buffer).internal_output_handler_buffer = (char *) emalloc(buffer_size);
        OG(active_ob_buffer).internal_output_handler_buffer_size = buffer_size;
+       if (OG(active_ob_buffer).handler_name)
+               efree(OG(active_ob_buffer).handler_name);
        OG(active_ob_buffer).handler_name = handler_name;
-       OG(active_ob_buffer).erase = erase;     
+       OG(active_ob_buffer).erase = erase;
 }
 /* }}} */