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:
@@ -92,6 +92,7 @@ compile_shader(const char *filename, gl_shader_stage shader_stage, struct shader
|
|||||||
if (file_size % WORD_SIZE != 0) {
|
if (file_size % WORD_SIZE != 0) {
|
||||||
fprintf(stderr, "%s size == %zu is not a multiple of %d\n", filename,
|
fprintf(stderr, "%s size == %zu is not a multiple of %d\n", filename,
|
||||||
file_size, WORD_SIZE);
|
file_size, WORD_SIZE);
|
||||||
|
free(file_contents);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user