From: Andrii Simiklit Date: Fri, 26 Oct 2018 14:29:34 +0000 (+0300) Subject: intel/tools: fix resource leak X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fc3cecda8cea97727ac5233e35e774035d3dff13;p=mesa.git intel/tools: fix resource leak Some memory and file descriptors are not freed/closed. v2: fixed case where we skipped the 'aub' variable initialization Signed-off-by: Andrii Simiklit Reviewed-by: Lionel Landwerlin --- diff --git a/src/intel/tools/error2aub.c b/src/intel/tools/error2aub.c index b6e056cbcde..fb4b4ffcfc6 100644 --- a/src/intel/tools/error2aub.c +++ b/src/intel/tools/error2aub.c @@ -327,6 +327,16 @@ main(int argc, char *argv[]) aub_write_exec(&aub, batch_addr, aub_gtt_size(&aub), I915_EXEC_RENDER); + free(out_filename); + free(line); + if(err_file) { + fclose(err_file); + } + if(aub.file) { + aub_file_finish(&aub); + } else if(aub_file) { + fclose(aub_file); + } return EXIT_SUCCESS; }