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 <andrii.simiklit@globallogic.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
This commit is contained in:
Andrii Simiklit 2018-10-26 17:29:34 +03:00 committed by Lionel Landwerlin
parent ae8e81b0e3
commit fc3cecda8c

View file

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