From 46a82aa3a6044998d17dded35249a562203f6138 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20=C5=9Alusarz?= Date: Wed, 9 Sep 2020 18:45:08 +0200 Subject: [PATCH] intel/tools: fix possible memory leak in the error path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Found by Coverity. Signed-off-by: Marcin Ĺšlusarz Reviewed-by: Lionel Landwerlin Part-of: --- src/intel/tools/i965_disasm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/intel/tools/i965_disasm.c b/src/intel/tools/i965_disasm.c index a2f7b8564d6..401ca860cb4 100644 --- a/src/intel/tools/i965_disasm.c +++ b/src/intel/tools/i965_disasm.c @@ -103,6 +103,7 @@ i965_disasm_read_binary(FILE *fp, size_t *end) size = fread(assembly, *end, 1, fp); if (!size) { + free(assembly); return NULL; } return assembly;