diff options
author | Andrew Bartlett <abartlet@samba.org> | 2004-10-25 04:19:02 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:04:38 -0500 |
commit | e5fc6dd0bb460017f6678202afc1b73acb58af09 (patch) | |
tree | 5951f48f22b888abf90e3467a32142c3f05d40e8 /source4/auth | |
parent | f7c6a9438dba17032aea102d18b44c6d96ae470b (diff) | |
download | samba-e5fc6dd0bb460017f6678202afc1b73acb58af09.tar.gz samba-e5fc6dd0bb460017f6678202afc1b73acb58af09.tar.bz2 samba-e5fc6dd0bb460017f6678202afc1b73acb58af09.zip |
r3186: Use the properties of the new talloc() system to handle the auth
session info and server info structures.
Andrew Bartlett
(This used to be commit 5bdf391b3bc10291739f5640be9a404dbbeda273)
Diffstat (limited to 'source4/auth')
-rw-r--r-- | source4/auth/auth_util.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/source4/auth/auth_util.c b/source4/auth/auth_util.c index c8bad6128c..839e87585b 100644 --- a/source4/auth/auth_util.c +++ b/source4/auth/auth_util.c @@ -534,18 +534,19 @@ BOOL make_auth_methods(struct auth_context *auth_context, struct auth_methods ** return True; } -NTSTATUS make_session_info(struct auth_serversupplied_info *server_info, +NTSTATUS make_session_info(TALLOC_CTX *mem_ctx, + struct auth_serversupplied_info *server_info, struct auth_session_info **session_info) { NTSTATUS nt_status; - *session_info = talloc_p(server_info, struct auth_session_info); + *session_info = talloc_p(mem_ctx, struct auth_session_info); if (!*session_info) { return NT_STATUS_NO_MEMORY; } - (*session_info)->refcount = 1; (*session_info)->server_info = server_info; + talloc_reference(*session_info, server_info); /* unless set otherwise, the session key is the user session * key from the auth subsystem */ @@ -570,12 +571,7 @@ NTSTATUS make_session_info(struct auth_serversupplied_info *server_info, void free_session_info(struct auth_session_info **session_info) { DEBUG(5,("attempting to free a session_info structure\n")); - if (*session_info) { - (*session_info)->refcount--; - if ((*session_info)->refcount <= 0) { - talloc_free((*session_info)); - } - } + talloc_free((*session_info)); *session_info = NULL; } |