summaryrefslogtreecommitdiff
path: root/source4/smb_server/smb2
diff options
context:
space:
mode:
Diffstat (limited to 'source4/smb_server/smb2')
-rw-r--r--source4/smb_server/smb2/sesssetup.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source4/smb_server/smb2/sesssetup.c b/source4/smb_server/smb2/sesssetup.c
index c99b443a35..3439f2f068 100644
--- a/source4/smb_server/smb2/sesssetup.c
+++ b/source4/smb_server/smb2/sesssetup.c
@@ -95,6 +95,10 @@ done:
failed:
req->status = auth_nt_status_squash(status);
smb2srv_sesssetup_send(req, io);
+ if (!NT_STATUS_IS_OK(status) && !
+ NT_STATUS_EQUAL(status, NT_STATUS_MORE_PROCESSING_REQUIRED)) {
+ talloc_free(smb_sess);
+ }
}
static void smb2srv_sesssetup_backend(struct smb2srv_request *req, union smb_sesssetup *io)
@@ -138,7 +142,7 @@ static void smb2srv_sesssetup_backend(struct smb2srv_request *req, union smb_ses
}
/* allocate a new session */
- smb_sess = smbsrv_session_new(req->smb_conn, gensec_ctx);
+ smb_sess = smbsrv_session_new(req->smb_conn, req->smb_conn, gensec_ctx);
if (!smb_sess) {
status = NT_STATUS_INSUFFICIENT_RESOURCES;
goto failed;