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:
Vinson Lee
2024-02-24 22:02:35 -08:00
committed by Marge Bot
parent 41722c6137
commit 6c190bdfe9
+1
View File
@@ -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;
}