Mesa (master): nir: fix memory leak in nir_cf_list_clone

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Aug 20 11:09:52 UTC 2020


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

Author: Rhys Perry <pendingchaos02 at gmail.com>
Date:   Thu Aug  6 14:17:31 2020 +0100

nir: fix memory leak in nir_cf_list_clone

Signed-off-by: Rhys Perry <pendingchaos02 at gmail.com>
Reviewed-by: Eric Anholt <eric at anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6206>

---

 src/compiler/nir/nir_clone.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/compiler/nir/nir_clone.c b/src/compiler/nir/nir_clone.c
index f57fce599c1..9e0bd7bf891 100644
--- a/src/compiler/nir/nir_clone.c
+++ b/src/compiler/nir/nir_clone.c
@@ -656,6 +656,9 @@ nir_cf_list_clone(nir_cf_list *dst, nir_cf_list *src, nir_cf_node *parent,
    clone_cf_list(&state, &dst->list, &src->list);
 
    fixup_phi_srcs(&state);
+
+   if (!remap_table)
+      free_clone_state(&state);
 }
 
 static nir_function_impl *



More information about the mesa-commit mailing list