lib/poll_funcs: free timers in poll_funcs_state_destructor()
authorRalph Boehme <slow@samba.org>
Thu, 15 Sep 2016 12:19:27 +0000 (14:19 +0200)
committerJeremy Allison <jra@samba.org>
Mon, 19 Sep 2016 01:32:10 +0000 (03:32 +0200)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12272

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
lib/poll_funcs/poll_funcs_tevent.c

index 3059ebc04c26a58e05866506e2a4d9c75a7bdca4..3d79b7500358fd53df289a0c40e144d10472988a 100644 (file)
@@ -474,6 +474,7 @@ struct poll_funcs *poll_funcs_init_tevent(TALLOC_CTX *mem_ctx)
 static int poll_funcs_state_destructor(struct poll_funcs_state *state)
 {
        size_t num_watches = talloc_array_length(state->watches);
+       size_t num_timeouts = talloc_array_length(state->timeouts);
        size_t i;
        /*
         * Make sure the watches are cleared before the contexts. The watches
@@ -482,6 +483,9 @@ static int poll_funcs_state_destructor(struct poll_funcs_state *state)
        for (i=0; i<num_watches; i++) {
                TALLOC_FREE(state->watches[i]);
        }
+       for (i=0; i<num_timeouts; i++) {
+               TALLOC_FREE(state->timeouts[i]);
+       }
        return 0;
 }