summaryrefslogtreecommitdiff
path: root/source4/smb_server/smb
diff options
context:
space:
mode:
Diffstat (limited to 'source4/smb_server/smb')
-rw-r--r--source4/smb_server/smb/sesssetup.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/source4/smb_server/smb/sesssetup.c b/source4/smb_server/smb/sesssetup.c
index b6bddaa5b1..56d9e64e31 100644
--- a/source4/smb_server/smb/sesssetup.c
+++ b/source4/smb_server/smb/sesssetup.c
@@ -60,7 +60,7 @@ static void sesssetup_old_send(struct auth_check_password_request *areq,
union smb_sesssetup *sess = talloc_get_type(req->io_ptr, union smb_sesssetup);
struct auth_serversupplied_info *server_info = NULL;
struct auth_session_info *session_info;
- struct smbsrv_session *smb_sess;
+ struct smbsrv_session *smb_sess = NULL;
NTSTATUS status;
status = auth_check_password_recv(areq, req, &server_info);
@@ -88,6 +88,10 @@ static void sesssetup_old_send(struct auth_check_password_request *areq,
sess->old.out.vuid = smb_sess->vuid;
failed:
+ if (!NT_STATUS_IS_OK(status)) {
+ talloc_free(smb_sess);
+ req->session = NULL;
+ }
status = auth_nt_status_squash(status);
smbsrv_sesssetup_backend_send(req, sess, status);
}
@@ -155,7 +159,7 @@ static void sesssetup_nt1_send(struct auth_check_password_request *areq,
union smb_sesssetup *sess = talloc_get_type(req->io_ptr, union smb_sesssetup);
struct auth_serversupplied_info *server_info = NULL;
struct auth_session_info *session_info;
- struct smbsrv_session *smb_sess;
+ struct smbsrv_session *smb_sess = NULL;
NTSTATUS status;
status = auth_check_password_recv(areq, req, &server_info);
@@ -204,6 +208,10 @@ static void sesssetup_nt1_send(struct auth_check_password_request *areq,
done:
status = NT_STATUS_OK;
failed:
+ if (!NT_STATUS_IS_OK(status)) {
+ talloc_free(smb_sess);
+ req->session = NULL;
+ }
status = auth_nt_status_squash(status);
smbsrv_sesssetup_backend_send(req, sess, status);
}
@@ -337,6 +345,10 @@ static void sesssetup_spnego_send(struct gensec_update_request *greq, void *priv
done:
sess->spnego.out.vuid = smb_sess->vuid;
failed:
+ if (!NT_STATUS_IS_OK(status)) {
+ talloc_free(smb_sess);
+ req->session = NULL;
+ }
status = auth_nt_status_squash(status);
smbsrv_sesssetup_backend_send(req, sess, status);
}