The branch, v3-3-test has been updated
       via  3077f2ab45b08595b4849add56110a37069d12ec (commit)
      from  7274764436deb21f821c7a62a3ac3454e1af9025 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-3-test


- Log -----------------------------------------------------------------
commit 3077f2ab45b08595b4849add56110a37069d12ec
Author: Volker Lendecke <[email protected]>
Date:   Fri Feb 13 11:18:31 2009 +0100

    Fix Coverity ID 745 (RESOURCE_LEAK)

-----------------------------------------------------------------------

Summary of changes:
 source/utils/ntlm_auth.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/utils/ntlm_auth.c b/source/utils/ntlm_auth.c
index 8dd433c..2c62bd5 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] 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;
 }
 


-- 
Samba Shared Repository

Reply via email to