Merge pull request #2715 from vloup/memory-leak-fix-2208

Fix memory leak in streams
This commit is contained in:
martinhsv
2022-06-07 17:10:22 -04:00
committed by GitHub
2 changed files with 17 additions and 0 deletions

View File

@@ -1,6 +1,8 @@
DD mmm YYYY - 2.9.x (to be released) DD mmm YYYY - 2.9.x (to be released)
------------------- -------------------
* Fix memory leak in streams
[Issue #2208 - @marcstern, @vloup, @JamesColeman-LW]
* Fix: negative usec on log line when data type long is 32b * Fix: negative usec on log line when data type long is 32b
[Issue #2753 - @ABrauer-CPT, @martinhsv] [Issue #2753 - @ABrauer-CPT, @martinhsv]
* mlogc log-line parsing fails due to enhanced timestamp * mlogc log-line parsing fails due to enhanced timestamp

View File

@@ -325,6 +325,21 @@ static apr_status_t modsecurity_tx_cleanup(void *data) {
#endif #endif
#endif #endif
/* Streams cleanup. */
if (msr->stream_input_data != NULL) {
free(msr->stream_input_data);
msr->stream_input_data = NULL;
msr->stream_input_length = 0;
#ifdef MSC_LARGE_STREAM_INPUT
msr->stream_input_allocated_length = 0;
#endif
}
if (msr->stream_output_data != NULL) {
free(msr->stream_output_data);
msr->stream_output_data = NULL;
msr->stream_output_length = 0;
}
return APR_SUCCESS; return APR_SUCCESS;
} }