zink: free all ntv allocations after creating shader module
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Wed, 3 Jun 2020 15:41:43 +0000 (11:41 -0400)
committerMarge Bot <eric+marge@anholt.net>
Sat, 18 Jul 2020 07:51:37 +0000 (07:51 +0000)
these are all fairly large sources of leaks

Reviewed-by: Antonio Caggiano <antonio.caggiano@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5887>

src/gallium/drivers/zink/zink_compiler.c

index 9b084d2a15c43a12b6be0789f492628af862c2c1..a17bc19432e286d8c9018d2002a6cc1baac15d32 100644 (file)
@@ -305,6 +305,9 @@ zink_compile_nir(struct zink_screen *screen, struct nir_shader *nir,
    if (vkCreateShaderModule(screen->dev, &smci, NULL, &ret->shader_module) != VK_SUCCESS)
       return NULL;
 
+   free(spirv->words);
+   free(spirv);
+
    return ret;
 }