aubinator: fix double free
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Wed, 24 May 2017 00:48:36 +0000 (01:48 +0100)
committerLionel Landwerlin <lionel.g.landwerlin@intel.com>
Wed, 24 May 2017 09:50:18 +0000 (10:50 +0100)
1;4601;0c
Free previously allocated filename outside the for loop.

CID: 1405014
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
src/intel/tools/aubinator_error_decode.c

index 37c66ec0f6856d1a442a60736e7c9505947fd81c..506d39012b869fd82efacf03160f5ca77a44da88 100644 (file)
@@ -874,8 +874,8 @@ main(int argc, char *argv[])
       file = fopen(filename, "r");
       if (!file) {
          int minor;
+         free(filename);
          for (minor = 0; minor < 64; minor++) {
-            free(filename);
             ret = asprintf(&filename, "%s/%d/i915_error_state", path, minor);
             assert(ret > 0);