summaryrefslogtreecommitdiff
path: root/source3/smbd/smb2_tcon.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/smbd/smb2_tcon.c')
-rw-r--r--source3/smbd/smb2_tcon.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/source3/smbd/smb2_tcon.c b/source3/smbd/smb2_tcon.c
index 1cfb4ceaa6..203325e71a 100644
--- a/source3/smbd/smb2_tcon.c
+++ b/source3/smbd/smb2_tcon.c
@@ -127,6 +127,8 @@ static int smbd_smb2_tcon_destructor(struct smbd_smb2_tcon *tcon)
idr_remove(tcon->session->tcons.idtree, tcon->tid);
DLIST_REMOVE(tcon->session->tcons.list, tcon);
+ SMB_ASSERT(tcon->session->sconn->num_tcons_open > 0);
+ tcon->session->sconn->num_tcons_open--;
if (tcon->compat_conn) {
set_current_service(tcon->compat_conn, 0, true);
@@ -214,6 +216,7 @@ static NTSTATUS smbd_smb2_tree_connect(struct smbd_smb2_request *req,
DLIST_ADD_END(req->session->tcons.list, tcon,
struct smbd_smb2_tcon *);
tcon->session = req->session;
+ tcon->session->sconn->num_tcons_open++;
talloc_set_destructor(tcon, smbd_smb2_tcon_destructor);
compat_conn = make_connection_snum(req->sconn,