summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2002-07-31 17:55:15 +0000
committerMarcus Boerger <helly@php.net>2002-07-31 17:55:15 +0000
commit4e05dd7c1b7f755871b6f0fd62464002f41f454c (patch)
treed79ed956f3992a4310c782b6bf1f68f491e1c29c /main
parenta842e12ad2299e7915397b3ea5a038ba0cedb663 (diff)
downloadphp-git-4e05dd7c1b7f755871b6f0fd62464002f41f454c.tar.gz
-problem with CLI/mbstring/output buffering
Diffstat (limited to 'main')
-rw-r--r--main/SAPI.c22
1 files 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;
}