summaryrefslogtreecommitdiff
path: root/sapi/apache/mod_php4.c
diff options
context:
space:
mode:
Diffstat (limited to 'sapi/apache/mod_php4.c')
-rw-r--r--sapi/apache/mod_php4.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sapi/apache/mod_php4.c b/sapi/apache/mod_php4.c
index f1f6c827c0..f07ac35418 100644
--- a/sapi/apache/mod_php4.c
+++ b/sapi/apache/mod_php4.c
@@ -295,10 +295,12 @@ static void php_apache_request_shutdown(void *dummy)
static int php_apache_sapi_activate(SLS_D)
{
- request_rec *r = ((request_rec *) SG(server_context));
+ request_rec *r;
SLS_FETCH();
APLS_FETCH();
+ r = (request_rec *) SG(server_context);
+
/*
* For the Apache module version, this bit of code registers a cleanup
* function that gets triggered when our request pool is destroyed.
@@ -308,7 +310,7 @@ static int php_apache_sapi_activate(SLS_D)
* memory.
*/
block_alarms();
- register_cleanup(((request_rec *) SG(server_context))->pool, NULL, php_apache_request_shutdown, php_request_shutdown_for_exec);
+ register_cleanup(r->pool, NULL, php_apache_request_shutdown, php_request_shutdown_for_exec);
AP(in_request)=1;
unblock_alarms();