From: Jeremy Allison Date: Mon, 19 Sep 2016 18:42:05 +0000 (-0700) Subject: lib/poll_funcs: free contexts in poll_funcs_state_destructor() X-Git-Tag: samba-4.3.12~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5eeeeff10b7d1054d9e955f09ca504cd2b6e6be4;p=thirdparty%2Fsamba.git 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 --- 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; }