s4-smbd: fix crash in notify code on client termination
authorAndrew Tridgell <tridge@samba.org>
Sat, 13 Feb 2010 12:09:59 +0000 (23:09 +1100)
committerAndrew Tridgell <tridge@samba.org>
Sat, 13 Feb 2010 12:12:29 +0000 (23:12 +1100)
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

source4/smbd/process_standard.c

index 145cbc0a2bfc1bd7c9b63b0b8a98605cdf0c2ec0..dfa4fa6b1c7a4b742bc99c27e0f2b934b3d157b5 100644 (file)
@@ -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);
 }