intel/clc: Fix file descriptor leak
Fix defect reported by Coverity Scan.
Resource leak (RESOURCE_LEAK)
leaked_storage: Variable fp going out of scope leaks the storage it points to.
Fixes: 4fd7495c69 ("intel/clc: add ability to output NIR")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27778>
This commit is contained in:
@@ -367,6 +367,7 @@ output_nir(const struct intel_clc_params *params, struct clc_binary *binary)
|
||||
params->llvm17_wa);
|
||||
if (!nir) {
|
||||
fprintf(stderr, "Failed to generate NIR out of SPIRV\n");
|
||||
fclose(fp);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user