Mesa (master): intel/tools: fix resource leak

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Nov 1 13:22:45 UTC 2018


Module: Mesa
Branch: master
Commit: fc3cecda8cea97727ac5233e35e774035d3dff13
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=fc3cecda8cea97727ac5233e35e774035d3dff13

Author: Andrii Simiklit <andrii.simiklit at globallogic.com>
Date:   Fri Oct 26 17:29:34 2018 +0300

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 at globallogic.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>

---

 src/intel/tools/error2aub.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/intel/tools/error2aub.c b/src/intel/tools/error2aub.c
index b6e056cbcd..fb4b4ffcfc 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;
 }
 




More information about the mesa-commit mailing list