s3: smbd: Tear down global_smbXsrv_client in the correct order.
authorJeremy Allison <jra@samba.org>
Tue, 24 Nov 2015 20:00:10 +0000 (12:00 -0800)
committerJeremy Allison <jra@samba.org>
Wed, 25 Nov 2015 02:40:46 +0000 (03:40 +0100)
The talloc heirarchy looks like this:

global_smbXsrv_client
    |                 |
    V                 V
    session_table    sconn
       |
       V
      session (destructor references global_smbXsrv_client->sconn)

So don't free global_smbXsrv_client->sconn before the
session destructor fires.

------------------------------------------------
6 <signal handler called>
7 0x00007f47ba82da1a in file_close_user (sconn=0x0, vuid=1584077283) at ../source3/smbd/files.c:250
8 0x00007f47ba922a74 in smbXsrv_session_logoff (session=0x7f47be8bbf80) at ../source3/smbd/smbXsrv_session.c:1404
9 0x00007f47ba921912 in smbXsrv_session_destructor (session=0x7f47be8bbf80) at ../source3/smbd/smbXsrv_session.c:1068
10 0x00007f47b784e2fc in _talloc_free_internal () from /usr/lib/libtalloc.so.2
11 0x00007f47b784f495 in _talloc_free_children_internal () from /usr/lib/libtalloc.so.2
12 0x00007f47b784e49f in _talloc_free_internal () from /usr/lib/libtalloc.so.2
13 0x00007f47b784f495 in _talloc_free_children_internal () from /usr/lib/libtalloc.so.2
14 0x00007f47b784e49f in _talloc_free_internal () from /usr/lib/libtalloc.so.2
15 0x00007f47b784f88e in _talloc_free () from /usr/lib/libtalloc.so.2
16 0x00007f47ba92b2f1 in exit_server_common (how=SERVER_EXIT_NORMAL, reason=0x0) at ../source3/smbd/server_exit.c:234
------------------------------------------------

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11375

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Nov 25 03:40:46 CET 2015 on sn-devel-104

source3/smbd/server_exit.c

index bf50394f4bfc067feb2de2544b327b6b04f802cb..80f118a30da87be5b1ac12915d029c55c4d7fd0c 100644 (file)
@@ -221,7 +221,6 @@ static void exit_server_common(enum server_exit_reason how,
                        talloc_free(xconn);
                        DO_PROFILE_INC(disconnect);
                }
-               TALLOC_FREE(client->sconn);
        }
        sconn = NULL;
        xconn = NULL;