lib/poll_funcs: free contexts in poll_funcs_state_destructor()
authorJeremy Allison <jra@samba.org>
Mon, 19 Sep 2016 18:42:05 +0000 (11:42 -0700)
committerKarolin Seeger <kseeger@samba.org>
Wed, 21 Sep 2016 09:55:16 +0000 (11:55 +0200)
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 <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
lib/poll_funcs/poll_funcs_tevent.c

index 8fdf08061e653f4d35083b4056bfb6f58d520df7..6052077ff3f04772c6bbb7ff94be711987c1ec16 100644 (file)
@@ -302,6 +302,9 @@ static int poll_funcs_state_destructor(struct poll_funcs_state *state)
        for (i=0; i<state->num_watches; i++) {
                TALLOC_FREE(state->watches[i]);
        }
+       for (i=0; i<state->num_contexts; i++) {
+               TALLOC_FREE(state->contexts[i]);
+       }
        return 0;
 }