s4/messaging: messaging_dgm_ref talloc hierarchy fix
authorRalph Boehme <slow@samba.org>
Fri, 9 Sep 2016 05:12:11 +0000 (07:12 +0200)
committerJeremy Allison <jra@samba.org>
Mon, 12 Sep 2016 22:19:26 +0000 (00:19 +0200)
commitcfce21281a835dbc7d7bb9560e4339f4c1acf907
treeb55855f50911eed8f108d6ac2ca621b7a04a3b1e
parentb3cf15e530fc41c4cf78e7adf3507b68436f2544
s4/messaging: messaging_dgm_ref talloc hierarchy fix

Ensure the messaging dgm context goes away *before* the tevent
context. The messaging dgm context will likely have active fd or timer
events, their rundown will touch the associated tevent context.

Otoh, I deliberately don't free the imessaging context here, that's going
to happen as part of freeing the talloc_autofree_context() as before. I
think it suffers the same problem, eg imessaging_deregister() works on
an imessaging_context that might already be freed. But as it works,
don't change it.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source4/lib/messaging/messaging.c
source4/lib/messaging/messaging.h
source4/smbd/server.c