r1124: ntlm_auth memory leak fixes by James Wilkinson - jwilk@alumni.cse.ucsc.edu
authorAndrew Bartlett <abartlet@samba.org>
Mon, 14 Jun 2004 02:56:48 +0000 (02:56 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 15:51:56 +0000 (10:51 -0500)
Andrew Bartlett
(This used to be commit 94c0827ce20d8d1084703f6f5e4ad3b3c33151f8)

source3/utils/ntlm_auth.c

index f2fb7dcaaf3000b92a10dd6f72d35c9bb6dfa0d4..3b2164497cd2562d5fc8f8b1bf4c5ebca4d84f94 100644 (file)
@@ -369,6 +369,7 @@ NTSTATUS contact_winbind_auth_crap(const char *username,
                nt_status = NT_STATUS_UNSUCCESSFUL;
                if (error_string)
                        *error_string = smb_xstrdup("Reading winbind reply failed!");
+               free_response(&response);
                return nt_status;
        }
        
@@ -376,6 +377,7 @@ NTSTATUS contact_winbind_auth_crap(const char *username,
        if (!NT_STATUS_IS_OK(nt_status)) {
                if (error_string) 
                        *error_string = smb_xstrdup(response.data.auth.error_string);
+               free_response(&response);
                return nt_status;
        }
 
@@ -390,10 +392,12 @@ NTSTATUS contact_winbind_auth_crap(const char *username,
 
        if (flags & WBFLAG_PAM_UNIX_NAME) {
                if (pull_utf8_allocate(unix_name, (char *)response.extra_data) == -1) {
+                       free_response(&response);
                        return NT_STATUS_NO_MEMORY;
                }
        }
 
+       free_response(&response);
        return nt_status;
 }