Memory leak in modsecurity_request_body_to_stream() · Issue #2208 · owasp-modsecurity/ModSecurity (original) (raw)

msr->stream_input_data buffer is never unallocated, leading to a memory leak on each request.
We should use the request memory pool.
This needs passing the pool as parameter in modsecurity_request_body_to_stream() and in read_request_body(). The request memory pool is available when calling read_request_body() (in hook_request_late() ).