summaryrefslogtreecommitdiff
path: root/source4/auth/auth_sam.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2006-01-31 01:50:54 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:51:37 -0500
commit7c7125be5dfdbacd702891e16529eb1412966f83 (patch)
treea5740baeadabc46793b30897c009892f8b5c53ad /source4/auth/auth_sam.c
parentbc72dfa91ac409d3879b1959b607fa9f30cec160 (diff)
downloadsamba-7c7125be5dfdbacd702891e16529eb1412966f83.tar.gz
samba-7c7125be5dfdbacd702891e16529eb1412966f83.tar.bz2
samba-7c7125be5dfdbacd702891e16529eb1412966f83.zip
r13247: Try to make better use of talloc in the auth/ and auth/gensec code.
We don't want temporary memory hanging around on the long-term contexts. Andrew Bartlett (This used to be commit 85b3f6ebddfb655fdd08d1799752e562a6ff9cb1)
Diffstat (limited to 'source4/auth/auth_sam.c')
-rw-r--r--source4/auth/auth_sam.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/source4/auth/auth_sam.c b/source4/auth/auth_sam.c
index c491088302..85506fb41b 100644
--- a/source4/auth/auth_sam.c
+++ b/source4/auth/auth_sam.c
@@ -616,14 +616,14 @@ NTSTATUS sam_get_server_info_principal(TALLOC_CTX *mem_ctx, const char *principa
return nt_status;
}
- nt_status = authsam_make_server_info(mem_ctx, sam_ctx, msgs[0], msgs_domain_ref[0],
+ nt_status = authsam_make_server_info(tmp_ctx, sam_ctx, msgs[0], msgs_domain_ref[0],
user_sess_key, lm_sess_key,
server_info);
- if (!NT_STATUS_IS_OK(nt_status)) {
- talloc_free(tmp_ctx);
- return nt_status;
+ if (NT_STATUS_IS_OK(nt_status)) {
+ talloc_steal(mem_ctx, *server_info);
}
- return NT_STATUS_OK;
+ talloc_free(tmp_ctx);
+ return nt_status;
}
static NTSTATUS authsam_check_password_internals(struct auth_method_context *ctx,