From 7c7125be5dfdbacd702891e16529eb1412966f83 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 31 Jan 2006 01:50:54 +0000 Subject: 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) --- source4/auth/auth_sam.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source4/auth/auth_sam.c') 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, -- cgit