summaryrefslogtreecommitdiff
path: root/sapi
diff options
context:
space:
mode:
authorGeorge Schlossnagle <gschlossnagle@php.net>2003-02-24 01:19:08 +0000
committerGeorge Schlossnagle <gschlossnagle@php.net>2003-02-24 01:19:08 +0000
commitf5fb75f3903942eb81963eb143105311fd81d706 (patch)
tree6fe6c2913c7b79fc8ba6c3c4fd797bfd21cefb60 /sapi
parentc87c4c7bd778429588c0e1240f2c29468fc4a535 (diff)
downloadphp-git-f5fb75f3903942eb81963eb143105311fd81d706.tar.gz
hopefully a fix for 19919
Diffstat (limited to 'sapi')
-rw-r--r--sapi/apache/mod_php4.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/sapi/apache/mod_php4.c b/sapi/apache/mod_php4.c
index f0cb048b7e..56aed52748 100644
--- a/sapi/apache/mod_php4.c
+++ b/sapi/apache/mod_php4.c
@@ -169,7 +169,11 @@ static int sapi_apache_header_handler(sapi_header_struct *sapi_header, sapi_head
{
char *header_name, *header_content, *p;
request_rec *r = (request_rec *) SG(server_context);
-
+ if(!r) {
+ efree(sapi_header->header);
+ return 0;
+ }
+
header_name = sapi_header->header;
header_content = p = strchr(header_name, ':');
@@ -293,11 +297,15 @@ static void php_apache_request_shutdown(void *dummy)
TSRMLS_FETCH();
php_output_set_status(0 TSRMLS_CC);
- SG(server_context) = NULL; /* The server context (request) is invalid by the time run_cleanups() is called */
if (AP(in_request)) {
AP(in_request) = 0;
php_request_shutdown(dummy);
}
+ SG(server_context) = NULL;
+ /*
+ * The server context (request) is NOT invalid by the time
+ * run_cleanups() is called
+ */
}
/* }}} */