cvs: php4 /main SAPI.c
| From: | Stefan Esser | Date: | Tue, 18 Jun 2002 15:05:00 +0000 |
| Subject: | cvs: php4 /main SAPI.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-12408@lists.php.net to get a copy of this message | ||
sesser Tue Jun 18 11:05:00 2002 EDT
Modified files:
/php4/main SAPI.c
Log:
fix: appending the default charset to text/ content types never worked
fix: removed double free
Index: php4/main/SAPI.c
diff -u php4/main/SAPI.c:1.131 php4/main/SAPI.c:1.132
--- php4/main/SAPI.c:1.131 Tue Jun 18 08:57:09 2002
+++ php4/main/SAPI.c Tue Jun 18 11:04:58 2002
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: SAPI.c,v 1.131 2002/06/18 12:57:09 sesser Exp $ */
+/* $Id: SAPI.c,v 1.132 2002/06/18 15:04:58 sesser Exp $ */
#include <ctype.h>
#include <sys/stat.h>
@@ -395,7 +395,7 @@
*/
SAPI_API int sapi_add_header_ex(char *header_line, uint header_line_len, zend_bool duplicate,
zend_bool replace TSRMLS_DC)
{
- int retval, free_header = 0;
+ int retval;
sapi_header_struct sapi_header;
char *colon_offset;
long myuid = 0L;
@@ -441,7 +441,7 @@
if (colon_offset) {
*colon_offset = 0;
if (!STRCASECMP(header_line, "Content-Type")) {
- char *ptr = colon_offset, *mimetype = NULL, *newheader;
+ char *ptr = colon_offset+1, *mimetype = NULL, *newheader;
size_t len = header_line_len - (ptr - header_line), newlen;
while (*ptr == ' ' && *ptr != '\0') {
ptr++;
@@ -457,7 +457,7 @@
sapi_header.header_len = newlen - 1;
colon_offset = strchr(newheader, ':');
*colon_offset = '\0';
- free_header = 1;
+ efree(header_line);
}
efree(mimetype);
SG(sapi_headers).send_default_content_type = 0;
@@ -570,9 +570,6 @@
}
zend_llist_add_element(&SG(sapi_headers).headers, (void *) &sapi_header);
- }
- if (free_header) {
- efree(sapi_header.header);
}
return SUCCESS;
}