From 4e05dd7c1b7f755871b6f0fd62464002f41f454c Mon Sep 17 00:00:00 2001 From: Marcus Boerger Date: Wed, 31 Jul 2002 17:55:15 +0000 Subject: [PATCH] -problem with CLI/mbstring/output buffering --- main/SAPI.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/main/SAPI.c b/main/SAPI.c index af39e3bbdc..3292a7c1c6 100644 --- a/main/SAPI.c +++ b/main/SAPI.c @@ -633,12 +633,23 @@ SAPI_API int sapi_header_op(sapi_header_op_enum op, void *arg TSRMLS_DC) } +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 @@ SAPI_API int sapi_send_headers(TSRMLS_D) 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; } -- 2.50.1