diff options
author | Andrew Tridgell <tridge@samba.org> | 2010-03-26 21:13:55 +1100 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2010-03-26 21:13:55 +1100 |
commit | 789d67c4992e008fe17b830d3b23e3b95a4e70d9 (patch) | |
tree | 116e6fe0ebc16b082839e46156516e2aeaa1a1dd | |
parent | 5609c504337b79fd6f521c42b414c650b23d0c9a (diff) | |
download | samba-789d67c4992e008fe17b830d3b23e3b95a4e70d9.tar.gz samba-789d67c4992e008fe17b830d3b23e3b95a4e70d9.tar.bz2 samba-789d67c4992e008fe17b830d3b23e3b95a4e70d9.zip |
s4-smbd: use tevent_re_initialise()
This fixes a crash bug on startup
-rw-r--r-- | source4/smbd/process_standard.c | 8 |
1 files changed, 6 insertions, 2 deletions
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(); |