]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
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>
Tue, 20 Sep 2016 08:10:18 +0000 (10:10 +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>
source3/lib/poll_funcs/poll_funcs_tevent.c

index 565cdaf1cfc57921b002a6f4451642f91d6766f4..aba989d8df53fb0fd4a19f3af8689987d2387e27 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;
 }