diff options
author | Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de> | 2009-10-16 13:48:17 +0200 |
---|---|---|
committer | Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de> | 2009-10-16 14:06:30 +0200 |
commit | 925e96029e8854a1a3ad59fb4844c02b5aa77527 (patch) | |
tree | 770aa5f71757e2b849c91a59e8869e393c3c4c27 /source4 | |
parent | ba7707176d6c4e6ee89b18c3070ec7be83079f9e (diff) | |
download | samba-925e96029e8854a1a3ad59fb4844c02b5aa77527.tar.gz samba-925e96029e8854a1a3ad59fb4844c02b5aa77527.tar.bz2 samba-925e96029e8854a1a3ad59fb4844c02b5aa77527.zip |
s4:auth_sam: Restructure tail in "authsam_get_server_info_principal" and fix a memory leak
Diffstat (limited to 'source4')
-rw-r--r-- | source4/auth/ntlm/auth_sam.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/source4/auth/ntlm/auth_sam.c b/source4/auth/ntlm/auth_sam.c index a64c56d920..58a21d2d22 100644 --- a/source4/auth/ntlm/auth_sam.c +++ b/source4/auth/ntlm/auth_sam.c @@ -332,6 +332,7 @@ NTSTATUS authsam_get_server_info_principal(TALLOC_CTX *mem_ctx, nt_status = sam_get_results_principal(sam_ctx, tmp_ctx, principal, user_attrs, &domain_dn, &msg); if (!NT_STATUS_IS_OK(nt_status)) { + talloc_free(tmp_ctx); return nt_status; } @@ -342,11 +343,15 @@ NTSTATUS authsam_get_server_info_principal(TALLOC_CTX *mem_ctx, msg, user_sess_key, lm_sess_key, server_info); - if (NT_STATUS_IS_OK(nt_status)) { - talloc_steal(mem_ctx, *server_info); + if (!NT_STATUS_IS_OK(nt_status)) { + talloc_free(tmp_ctx); + return nt_status; } + + talloc_steal(mem_ctx, *server_info); talloc_free(tmp_ctx); - return nt_status; + + return NT_STATUS_OK; } static const struct auth_operations sam_ignoredomain_ops = { |