vc4: Fix leaks of the compiled shaders' keys.
authorEric Anholt <eric@anholt.net>
Mon, 15 Dec 2014 04:50:15 +0000 (20:50 -0800)
committerEric Anholt <eric@anholt.net>
Mon, 15 Dec 2014 07:12:11 +0000 (23:12 -0800)
src/gallium/drivers/vc4/vc4_program.c

index 3af738f6c4bd736dc9f69eb3dc977a234370562c..781e7e2f7f17a927683671a617cfc5d49e33e587 100644 (file)
@@ -2254,7 +2254,7 @@ vc4_get_compiled_shader(struct vc4_context *vc4, enum qstage stage,
         qir_compile_destroy(c);
 
         struct vc4_key *dup_key;
-        dup_key = malloc(key_size);
+        dup_key = ralloc_size(shader, key_size);
         memcpy(dup_key, key, key_size);
         _mesa_hash_table_insert(ht, dup_key, shader);