Skip to content

Commit 21a63cb

Browse files
Ephraim Viderzimmerle
authored andcommitted
json parser handle cleanup
1 parent 923c3c6 commit 21a63cb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

apache2/msc_json.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,10 +306,14 @@ int json_complete(modsec_rec *msr, char **error_msg) {
306306
}
307307

308308
/**
309-
* Frees the resources used for XML parsing.
309+
* Frees the resources used for JSON parsing.
310310
*/
311311
apr_status_t json_cleanup(modsec_rec *msr) {
312312
msr_log(msr, 4, "JSON: Cleaning up JSON results");
313+
if (msr->json->handle != NULL) {
314+
yajl_free(msr->json->handle);
315+
msr->json->handle = NULL;
316+
}
313317

314318
return 1;
315319
}

0 commit comments

Comments
 (0)