Commit fc3cecda authored by Andrii Simiklit's avatar Andrii Simiklit Committed by Lionel Landwerlin

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: 's avatarAndrii Simiklit <andrii.simiklit@globallogic.com>
Reviewed-by: Lionel Landwerlin's avatarLionel Landwerlin <lionel.g.landwerlin@intel.com>
parent ae8e81b0
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment