From 789d67c4992e008fe17b830d3b23e3b95a4e70d9 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 26 Mar 2010 21:13:55 +1100 Subject: s4-smbd: use tevent_re_initialise() This fixes a crash bug on startup --- source4/smbd/process_standard.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'source4/smbd') diff --git a/source4/smbd/process_standard.c b/source4/smbd/process_standard.c index dfa4fa6b1c..032b999d4e 100644 --- a/source4/smbd/process_standard.c +++ b/source4/smbd/process_standard.c @@ -120,7 +120,9 @@ static void standard_accept_connection(struct tevent_context *ev, /* this will free all the listening sockets and all state that is not associated with this new connection */ talloc_free(sock); - talloc_free(ev); + if (tevent_re_initialise(ev) != 0) { + smb_panic("Failed to re-initialise tevent after fork"); + } /* we don't care if the dup fails, as its only a select() speed optimisation */ @@ -192,7 +194,9 @@ static void standard_new_task(struct tevent_context *ev, /* this will free all the listening sockets and all state that is not associated with this new connection */ - talloc_free(ev); + if (tevent_re_initialise(ev) != 0) { + smb_panic("Failed to re-initialise tevent after fork"); + } /* ldb/tdb need special fork handling */ ldb_wrap_fork_hook(); -- cgit