Skip to content

Commit 67ab3cf

Browse files
committed
Fix SAPI compilation again
1 parent 1e6128b commit 67ab3cf

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

main/SAPI.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ SAPI_API int sapi_add_header_ex(const char *header_line, size_t header_line_len,
622622
&ctr);
623623

624624
if (!duplicate)
625-
efree(header_line);
625+
efree((void *) header_line);
626626

627627
return r;
628628
}
@@ -682,7 +682,7 @@ SAPI_API int sapi_header_op(sapi_header_op_enum op, void *arg)
682682
if (!p->line || !p->line_len) {
683683
return FAILURE;
684684
}
685-
header_line = p->line;
685+
header_line = estrndup(p->line, p->line_len);
686686
header_line_len = p->line_len;
687687
http_response_code = p->response_code;
688688
break;
@@ -699,8 +699,6 @@ SAPI_API int sapi_header_op(sapi_header_op_enum op, void *arg)
699699
return FAILURE;
700700
}
701701

702-
header_line = estrndup(header_line, header_line_len);
703-
704702
/* cut off trailing spaces, linefeeds and carriage-returns */
705703
if (header_line_len && isspace(header_line[header_line_len-1])) {
706704
do {
@@ -1115,7 +1113,7 @@ SAPI_API void sapi_add_request_header(const char *var, unsigned int var_len, con
11151113
var[3] == 'P' &&
11161114
var[4] == '_') {
11171115

1118-
char *p;
1116+
const char *p;
11191117

11201118
var_len -= 5;
11211119
p = var + 5;
@@ -1146,7 +1144,7 @@ SAPI_API void sapi_add_request_header(const char *var, unsigned int var_len, con
11461144
}
11471145
add_assoc_stringl_ex(return_value, var, var_len, val, val_len);
11481146
if (str) {
1149-
free_alloca(var, use_heap);
1147+
free_alloca((void *) var, use_heap);
11501148
}
11511149
}
11521150
/* }}} */

0 commit comments

Comments
 (0)