File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -205,15 +205,22 @@ static void sapi_read_post_data(void)
205
205
SG (request_info ).post_entry = NULL ;
206
206
if (!sapi_module .default_post_reader ) {
207
207
/* no default reader ? */
208
- SG (request_info ).content_type_dup = NULL ;
208
+ if (SG (request_info ).content_type_dup ) {
209
+ efree (SG (request_info ).content_type_dup );
210
+ SG (request_info ).content_type_dup = NULL ;
211
+ }
209
212
sapi_module .sapi_error (E_WARNING , "Unsupported content type: '%s'" , content_type );
213
+ efree (content_type );
210
214
return ;
211
215
}
212
216
}
213
217
if (oldchar ) {
214
218
* (p - 1 ) = oldchar ;
215
219
}
216
220
221
+ if (SG (request_info ).content_type_dup ) {
222
+ efree (SG (request_info ).content_type_dup );
223
+ }
217
224
SG (request_info ).content_type_dup = content_type ;
218
225
219
226
if (post_reader_func ) {
@@ -462,6 +469,9 @@ SAPI_API void sapi_activate(void)
462
469
* depending on given content type */
463
470
sapi_read_post_data ();
464
471
} else {
472
+ if (SG (request_info ).content_type_dup ) {
473
+ efree (SG (request_info ).content_type_dup );
474
+ }
465
475
SG (request_info ).content_type_dup = NULL ;
466
476
}
467
477
You can’t perform that action at this time.
0 commit comments