i965: Free serialized nir after deserializing
authorJordan Justen <jordan.l.justen@intel.com>
Fri, 3 Nov 2017 23:45:46 +0000 (16:45 -0700)
committerTimothy Arceri <tarceri@itsqueeze.com>
Fri, 8 Dec 2017 05:44:35 +0000 (16:44 +1100)
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/mesa/drivers/dri/i965/brw_program.c

index 2a647cdd734edea75fa31e254d9af20ff99be73e..30cc14e88a25543d1d02d4b1cd4c8f3b192b6aeb 100644 (file)
@@ -800,4 +800,10 @@ brw_program_deserialize_nir(struct gl_context *ctx, struct gl_program *prog,
                        prog->driver_cache_blob_size);
       prog->nir = nir_deserialize(NULL, options, &reader);
    }
+
+   if (prog->driver_cache_blob) {
+      ralloc_free(prog->driver_cache_blob);
+      prog->driver_cache_blob = NULL;
+      prog->driver_cache_blob_size = 0;
+   }
 }