iris: Free the buffer when reading from the disk cache.
authorKenneth Graunke <kenneth@whitecape.org>
Wed, 5 Jun 2019 05:02:24 +0000 (22:02 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Wed, 5 Jun 2019 06:53:57 +0000 (23:53 -0700)
src/gallium/drivers/iris/iris_disk_cache.c

index 797913613f25200f59b2e3485697d283087b4e1e..675f0095ab61968f06170d46251c88d8e65aaa0d 100644 (file)
@@ -213,9 +213,14 @@ iris_disk_cache_retrieve(struct iris_context *ice,
    /* Upload our newly read shader to the in-memory program cache and
     * return it to the caller.
     */
-   return iris_upload_shader(ice, stage, key_size, prog_key, assembly,
-                             prog_data, so_decls, system_values,
-                             num_system_values, num_cbufs, &bt);
+   struct iris_compiled_shader *shader =
+      iris_upload_shader(ice, stage, key_size, prog_key, assembly,
+                         prog_data, so_decls, system_values,
+                         num_system_values, num_cbufs, &bt);
+
+   free(buffer);
+
+   return shader;
 #else
    return NULL;
 #endif