Mesa (master): zink: free all ntv allocations after creating shader module

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Jul 18 10:46:45 UTC 2020


Module: Mesa
Branch: master
Commit: 2b343238a1fc2954d10770082ff873a28efafee2
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=2b343238a1fc2954d10770082ff873a28efafee2

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Wed Jun  3 11:41:43 2020 -0400

zink: free all ntv allocations after creating shader module

these are all fairly large sources of leaks

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

---

 src/gallium/drivers/zink/zink_compiler.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/gallium/drivers/zink/zink_compiler.c b/src/gallium/drivers/zink/zink_compiler.c
index 9b084d2a15c..a17bc19432e 100644
--- a/src/gallium/drivers/zink/zink_compiler.c
+++ b/src/gallium/drivers/zink/zink_compiler.c
@@ -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;
 }
 



More information about the mesa-commit mailing list