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 @@ -209,15 +209,22 @@ static void sapi_read_post_data(void)
209
209
SG (request_info ).post_entry = NULL ;
210
210
if (!sapi_module .default_post_reader ) {
211
211
/* no default reader ? */
212
- SG (request_info ).content_type_dup = NULL ;
212
+ if (SG (request_info ).content_type_dup ) {
213
+ efree (SG (request_info ).content_type_dup );
214
+ SG (request_info ).content_type_dup = NULL ;
215
+ }
213
216
sapi_module .sapi_error (E_WARNING , "Unsupported content type: '%s'" , content_type );
217
+ efree (content_type );
214
218
return ;
215
219
}
216
220
}
217
221
if (oldchar ) {
218
222
* (p - 1 ) = oldchar ;
219
223
}
220
224
225
+ if (SG (request_info ).content_type_dup ) {
226
+ efree (SG (request_info ).content_type_dup );
227
+ }
221
228
SG (request_info ).content_type_dup = content_type ;
222
229
223
230
if (post_reader_func ) {
@@ -466,6 +473,9 @@ SAPI_API void sapi_activate(void)
466
473
* depending on given content type */
467
474
sapi_read_post_data ();
468
475
} else {
476
+ if (SG (request_info ).content_type_dup ) {
477
+ efree (SG (request_info ).content_type_dup );
478
+ }
469
479
SG (request_info ).content_type_dup = NULL ;
470
480
}
471
481
You can’t perform that action at this time.
0 commit comments