From 6c190bdfe97ca4666f1ab2d861a8dd720a1f7597 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sat, 24 Feb 2024 22:02:35 -0800 Subject: [PATCH] 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: 4fd7495c6938 ("intel/clc: add ability to output NIR") Signed-off-by: Vinson Lee Reviewed-by: Lionel Landwerlin Part-of: --- src/intel/compiler/intel_clc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/intel/compiler/intel_clc.c b/src/intel/compiler/intel_clc.c index c0b38cc6810..8bfe91b708e 100644 --- a/src/intel/compiler/intel_clc.c +++ b/src/intel/compiler/intel_clc.c @@ -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; }