Ping? This patch fixes an active memory leak.

Any comments? Thanks.

Eduardo


On 11/14/2017 11:18 PM, Eduardo Lima Mitev wrote:
In nir_cf_list_clone(), a state_clone object is initialized but never
freed, causing a memory leak. If the remap_table argument is NULL,
init_state will create a hash table for it, and that's what
free_clone_state is supposed to free.
---
  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 bcfdaa7594..c823acb6ee 100644
--- a/src/compiler/nir/nir_clone.c
+++ b/src/compiler/nir/nir_clone.c
@@ -660,6 +660,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 *

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to