radv: fix memory leak when restoring from cache
authorTimothy Arceri <tarceri@itsqueeze.com>
Wed, 10 Jul 2019 04:11:23 +0000 (14:11 +1000)
committerTimothy Arceri <tarceri@itsqueeze.com>
Thu, 11 Jul 2019 00:44:29 +0000 (10:44 +1000)
Fixes: 726a31df705b ("radv: Add the concept of radv shader binaries.")
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
src/amd/vulkan/radv_pipeline_cache.c

index 2b3fda6eb8e1d50e0801cba7f50d6169da7f4930..b773de30c326b73003520dda79fbe4ab075ebe3a 100644 (file)
@@ -309,6 +309,7 @@ radv_create_shader_variants_from_pipeline_cache(struct radv_device *device,
                        p += entry->binary_sizes[i];
 
                        entry->variants[i] = radv_shader_variant_create(device, binary);
+                       free(binary);
                } else if (entry->binary_sizes[i]) {
                        p += entry->binary_sizes[i];
                }