nir: fix memory leak in nir_cf_list_clone
authorRhys Perry <pendingchaos02@gmail.com>
Thu, 6 Aug 2020 13:17:31 +0000 (14:17 +0100)
committerMarge Bot <eric+marge@anholt.net>
Thu, 20 Aug 2020 10:52:19 +0000 (10:52 +0000)
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6206>

src/compiler/nir/nir_clone.c

index f57fce599c1c7af127bb5bc24b7920520667b106..9e0bd7bf8918cbf9f61c9f1e9b170ab04c490144 100644 (file)
@@ -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 *