mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 02:28:10 +02:00
spirv2dxil: Fix memory leak on error path.
Fix resource leak reported by Coverity Scan.
Resource leak (RESOURCE_LEAK)
leaked_storage: Variable file_contents going out of scope leaks the storage it points to.
Fixes: 531d17c334 ("spirv2dxil: Support linking multiple shaders")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20576>
This commit is contained in:
parent
9b29876a02
commit
84527093c4
1 changed files with 1 additions and 0 deletions
|
|
@ -92,6 +92,7 @@ compile_shader(const char *filename, gl_shader_stage shader_stage, struct shader
|
|||
if (file_size % WORD_SIZE != 0) {
|
||||
fprintf(stderr, "%s size == %zu is not a multiple of %d\n", filename,
|
||||
file_size, WORD_SIZE);
|
||||
free(file_contents);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue