summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
Diffstat (limited to 'source4')
-rw-r--r--source4/smbd/process_standard.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/source4/smbd/process_standard.c b/source4/smbd/process_standard.c
index ca93f93ce55..f786d4dcc22 100644
--- a/source4/smbd/process_standard.c
+++ b/source4/smbd/process_standard.c
@@ -388,12 +388,13 @@ _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);
+ /* Always free event context last before exit. */
+ talloc_free(ev);
+
/* terminate this process */
exit(0);
}