From 30fca3b2e65c6125c24894ed11b15e09a52b42e6 Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Thu, 6 Aug 2020 14:17:31 +0100 Subject: [PATCH] nir: fix memory leak in nir_cf_list_clone Signed-off-by: Rhys Perry Reviewed-by: Eric Anholt Part-of: --- 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 * -- 2.30.2