intel: fix memory leak related to brw_nir_create_passthrough_tcs()
authorPatrick Lerda <patrick9876@free.fr>
Mon, 27 Mar 2023 09:45:12 +0000 (11:45 +0200)
committerMarge Bot <emma+marge@anholt.net>
Thu, 30 Mar 2023 10:52:07 +0000 (10:52 +0000)
commit5d85966805df93e11669b21df1cbdeb3dcb2e565
tree9f9ec4f5dbd6ad0296467cbd44249a881871a1cc
parent9c90deefb2356c970520a404375b0e1796df1535
intel: fix memory leak related to brw_nir_create_passthrough_tcs()

Indeed, the parameter "mem_ctx" was not processed.

For instance, this issue is triggered with the crocus driver and
"piglit/bin/shader_runner tests/spec/arb_tessellation_shader/execution/compatibility/tes-clip-vertex-different-from-position.shader_test -auto -fbo":
SUMMARY: AddressSanitizer: 235216 byte(s) leaked in 48 allocation(s).

Fixes: 96ba0344db8f ("intel: Use common helpers for TCS passthrough shaders")
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22173>
src/intel/compiler/brw_nir.c