cvs: php4 /main SAPI.c

From: Date: Wed, 31 Jul 2002 17:55:15 +0000
Subject: cvs: php4 /main SAPI.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-13064@lists.php.net to get a copy of this message
helly Wed Jul 31 13:55:15 2002 EDT Modified files: /php4/main SAPI.c Log: -problem with CLI/mbstring/output buffering Index: php4/main/SAPI.c diff -u php4/main/SAPI.c:1.138 php4/main/SAPI.c:1.139 --- php4/main/SAPI.c:1.138 Sun Jul 28 10:08:08 2002 +++ php4/main/SAPI.c Wed Jul 31 13:55:15 2002 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: SAPI.c,v 1.138 2002/07/28 14:08:08 sr Exp $ */ +/* $Id: SAPI.c,v 1.139 2002/07/31 17:55:15 helly Exp $ */ #include <ctype.h> #include <sys/stat.h> @@ -633,12 +633,23 @@ } +static void sapi_send_headers_free(TSRMLS_D) +{ + if (SG(sapi_headers).http_status_line) { + efree(SG(sapi_headers).http_status_line); + } + if (SG(sapi_headers).mimetype) { + efree(SG(sapi_headers).mimetype); + } +} + SAPI_API int sapi_send_headers(TSRMLS_D) { int retval; int ret = FAILURE; if (SG(headers_sent) || SG(request_info).no_headers) { + sapi_send_headers_free(TSRMLS_C); return SUCCESS; } @@ -711,14 +722,9 @@ ret = FAILURE; break; } - - if (SG(sapi_headers).http_status_line) { - efree(SG(sapi_headers).http_status_line); - } - if (SG(sapi_headers).mimetype) { - efree(SG(sapi_headers).mimetype); - } - + + sapi_send_headers_free(TSRMLS_C); + return ret; }

« previous php.cvs (#13064) next »