From fc3cecda8cea97727ac5233e35e774035d3dff13 Mon Sep 17 00:00:00 2001 From: Andrii Simiklit Date: Fri, 26 Oct 2018 17:29:34 +0300 Subject: 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 --- src/intel/tools/error2aub.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/intel/tools') 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; } -- cgit v1.2.3