diff options
Diffstat (limited to 'source4/smb_server/password.c')
-rw-r--r-- | source4/smb_server/password.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/source4/smb_server/password.c b/source4/smb_server/password.c index c302f65980..d553d8612d 100644 --- a/source4/smb_server/password.c +++ b/source4/smb_server/password.c @@ -58,8 +58,6 @@ void smbsrv_invalidate_vuid(struct smbsrv_connection *smb_conn, uint16_t vuid) session_yield(sess); - free_session_info(&sess->session_info); - DLIST_REMOVE(smb_conn->sessions.session_list, sess); /* clear the vuid from the 'cache' on each connection, and @@ -135,8 +133,13 @@ uint16_t smbsrv_register_session(struct smbsrv_connection *smb_conn, smb_conn->sessions.num_validated_vuids++; /* use this to keep tabs on all our info from the authentication */ - sess->session_info = session_info; - sess->gensec_ctx = gensec_ctx; + if (session_info) { + sess->session_info = talloc_reference(sess, session_info); + } + + if (gensec_ctx) { + sess->gensec_ctx = talloc_reference(sess, gensec_ctx); + } sess->smb_conn = smb_conn; DLIST_ADD(smb_conn->sessions.session_list, sess); |