From 01ed736827f637cb2a6d2402a2a29e8b4a0d7124 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Wed, 23 Sep 2015 16:16:04 +0300 Subject: [PATCH] Don't keep dangling pointers --- sapi/cgi/cgi_main.c | 10 ++++++++-- sapi/litespeed/lsapi_main.c | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c index e76da2a5b1..6293470472 100644 --- a/sapi/cgi/cgi_main.c +++ b/sapi/cgi/cgi_main.c @@ -2353,7 +2353,10 @@ consult the installation file that came with this distribution, or visit \n\ goto fastcgi_request_done; } - if (SG(request_info).path_translated) efree(SG(request_info).path_translated); + if (SG(request_info).path_translated) { + efree(SG(request_info).path_translated); + SG(request_info).path_translated = NULL; + } if (free_query_string && SG(request_info).query_string) { free(SG(request_info).query_string); @@ -2487,7 +2490,10 @@ consult the installation file that came with this distribution, or visit \n\ fastcgi_request_done: { - if (SG(request_info).path_translated) efree(SG(request_info).path_translated); + if (SG(request_info).path_translated) { + efree(SG(request_info).path_translated); + SG(request_info).path_translated = NULL; + } php_request_shutdown((void *) 0); diff --git a/sapi/litespeed/lsapi_main.c b/sapi/litespeed/lsapi_main.c index e58587dbe3..13bca0cab3 100644 --- a/sapi/litespeed/lsapi_main.c +++ b/sapi/litespeed/lsapi_main.c @@ -173,6 +173,7 @@ static int sapi_lsapi_deactivate(void) if ( SG(request_info).path_translated ) { efree( SG(request_info).path_translated ); + SG(request_info).path_translated = NULL; } return SUCCESS; -- 2.40.0