From: Andrew Tridgell Date: Sat, 13 Feb 2010 12:09:59 +0000 (+1100) Subject: s4-smbd: fix crash in notify code on client termination X-Git-Tag: release-3-6-0pre1~5345 X-Git-Url: http://git.samba.org/?a=commitdiff_plain;h=f69135e0e985200d62d4618b742bd642ecfdbf31;p=amitay%2Fsamba.git s4-smbd: fix crash in notify code on client termination We need to free the lp_ctx after we free the event context, otherwise the teardown code in the notify backend dies when it tries to use the iconv_convenience ptr Fixes bug 7053 --- diff --git a/source4/smbd/process_standard.c b/source4/smbd/process_standard.c index 145cbc0a2bf..dfa4fa6b1c7 100644 --- a/source4/smbd/process_standard.c +++ b/source4/smbd/process_standard.c @@ -225,12 +225,12 @@ _NORETURN_ static void standard_terminate(struct tevent_context *ev, struct load { DEBUG(2,("standard_terminate: reason[%s]\n",reason)); + talloc_free(ev); + /* this reload_charcnv() has the effect of freeing the iconv context memory, which makes leak checking easier */ reload_charcnv(lp_ctx); - talloc_free(ev); - /* terminate this process */ exit(0); }