]> granicus.if.org Git - php/commitdiff
Fixes
authorZeev Suraski <zeev@php.net>
Wed, 5 May 1999 21:29:26 +0000 (21:29 +0000)
committerZeev Suraski <zeev@php.net>
Wed, 5 May 1999 21:29:26 +0000 (21:29 +0000)
ext/standard/basic_functions.c
ext/standard/head.c
main/SAPI.c
main/main.c

index 6ed4496eb58467da4f794976d0fd7ca8b81de67a..2a8f59d75eb88ced5d465582824c5c60011d7389 100644 (file)
@@ -291,6 +291,8 @@ function_entry basic_functions[] = {
        PHP_FE(ini_restore,                                     NULL)
 
        PHP_FE(print_r,                                 NULL)
+       {"setcookie",           php3_SetCookie,         NULL},
+       {"header",                      php3_Header,            NULL},
 
        {NULL, NULL, NULL}
 };
index 8e757a3e079410dc37563d6d436759a5ca78b99d..636f1438039d5de7c4551b495558fb2b63f3ffc2 100644 (file)
@@ -221,6 +221,8 @@ void php3_Header(INTERNAL_FUNCTION_PARAMETERS)
        }
        convert_to_string(arg1);
        php4i_add_header_information(arg1->value.str.val, arg1->value.str.len);
+       arg1->type = IS_LONG; /* change arg1's type so that it doesn't get freed */
+       arg1->value.lval = 0;
 }
 
 
@@ -572,8 +574,6 @@ int php3_headers_unsent(void)
 
 
 function_entry php3_header_functions[] = {
-       {"setcookie",           php3_SetCookie,         NULL},
-       {"header",                      php3_Header,            NULL},
        {NULL, NULL, NULL}
 };
 
index af8f1f0b39ac8569299fa5906dbc92ef97b0534b..a8077265e778a513f0e8fd972453d775e6a202ea 100644 (file)
@@ -48,6 +48,9 @@ SAPI_API void sapi_activate(SLS_D)
 SAPI_API void sapi_deactivate(SLS_D)
 {
        zend_llist_destroy(&SG(sapi_headers).headers);
+       if (SG(sapi_headers).content_type.header) {
+               efree(SG(sapi_headers).content_type.header);
+       }
 }
 
 
index 60d4bab7a277647e7b643b1b3c0853ccd9eedeb1..0ce2c62570baa00a7eceb1840b4aeaedec44bde8 100644 (file)
@@ -669,16 +669,18 @@ void php_request_shutdown(void *dummy)
        
        php_ini_rshutdown();
 
+
        shutdown_scanner(CLS_C);
        shutdown_compiler(CLS_C);
        shutdown_executor(ELS_C);
 
+       sapi_deactivate(SLS_C);
+
        php3_destroy_request_info(NULL);
        shutdown_memory_manager(PG(unclean_shutdown), 0);
        php3_unset_timeout();
 
 
-       sapi_deactivate(SLS_C);
 
 #if CGI_BINARY
        fflush(stdout);