From 5eeeeff10b7d1054d9e955f09ca504cd2b6e6be4 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 19 Sep 2016 11:42:05 -0700 Subject: [PATCH] lib/poll_funcs: free contexts in poll_funcs_state_destructor() This ensures the destructors get called in the proper order. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12272 Back-port from c132b78c484c14d255a98567e90b934b73ebf8c2 Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- source3/lib/poll_funcs/poll_funcs_tevent.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source3/lib/poll_funcs/poll_funcs_tevent.c b/source3/lib/poll_funcs/poll_funcs_tevent.c index 565cdaf1cfc..aba989d8df5 100644 --- a/source3/lib/poll_funcs/poll_funcs_tevent.c +++ b/source3/lib/poll_funcs/poll_funcs_tevent.c @@ -302,6 +302,9 @@ static int poll_funcs_state_destructor(struct poll_funcs_state *state) for (i=0; inum_watches; i++) { TALLOC_FREE(state->watches[i]); } + for (i=0; inum_contexts; i++) { + TALLOC_FREE(state->contexts[i]); + } return 0; } -- 2.47.2