diff options
author | Volker Lendecke <vl@samba.org> | 2009-02-13 11:18:31 +0100 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2009-02-16 09:57:03 +0100 |
commit | a83324752ab973c79e2d0f25a154c5d3d221a7fc (patch) | |
tree | b347d0e18284494300a674a936755bffb85f473a /source | |
parent | b9d5c1c091742dc20c24179332733b0052af2217 (diff) | |
download | samba-a83324752ab973c79e2d0f25a154c5d3d221a7fc.tar.gz |
Fix Coverity ID 745 (RESOURCE_LEAK)
(cherry picked from commit 3077f2ab45b08595b4849add56110a37069d12ec)
Diffstat (limited to 'source')
-rw-r--r-- | source/utils/ntlm_auth.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/source/utils/ntlm_auth.c b/source/utils/ntlm_auth.c index 8dd433c5386..2c62bd5c88f 100644 --- a/source/utils/ntlm_auth.c +++ b/source/utils/ntlm_auth.c @@ -523,10 +523,10 @@ static NTSTATUS winbind_pw_check(struct ntlmssp_state *ntlmssp_state, DATA_BLOB { static const char zeros[16] = { 0, }; NTSTATUS nt_status; - char *error_string; + char *error_string = NULL; uint8 lm_key[8]; uint8 user_sess_key[16]; - char *unix_name; + char *unix_name = NULL; nt_status = contact_winbind_auth_crap(ntlmssp_state->user, ntlmssp_state->domain, ntlmssp_state->workstation, @@ -548,7 +548,6 @@ static NTSTATUS winbind_pw_check(struct ntlmssp_state *ntlmssp_state, DATA_BLOB *user_session_key = data_blob(user_sess_key, 16); } ntlmssp_state->auth_context = talloc_strdup(ntlmssp_state->mem_ctx, unix_name); - SAFE_FREE(unix_name); } else { DEBUG(NT_STATUS_EQUAL(nt_status, NT_STATUS_ACCESS_DENIED) ? 0 : 3, ("Login for user [%s]\\[%s]@[%s] failed due to [%s]\n", @@ -557,6 +556,9 @@ static NTSTATUS winbind_pw_check(struct ntlmssp_state *ntlmssp_state, DATA_BLOB error_string ? error_string : "unknown error (NULL)")); ntlmssp_state->auth_context = NULL; } + + SAFE_FREE(error_string); + SAFE_FREE(unix_name); return nt_status; } |