intel/tools: fix possible memory leak in the error path

Found by Coverity.

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6667>
This commit is contained in:
Marcin Ślusarz 2020-09-09 18:45:08 +02:00 committed by Marge Bot
parent 5ea0b6a9c6
commit 46a82aa3a6

View file

@ -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;