s3:winbindd: consistently use TALLOC_FREE(conn->foo_pipe) is we create a new connection
authorStefan Metzmacher <metze@samba.org>
Thu, 25 Mar 2010 14:17:07 +0000 (15:17 +0100)
committerStefan Metzmacher <metze@samba.org>
Mon, 29 Mar 2010 16:11:18 +0000 (18:11 +0200)
metze

source3/winbindd/winbindd_cm.c

index 24e555607baf510afa6addb1c7ffb0b56d89870d..c5f93728ba2711035ddb21f931b339950d4bd2e1 100644 (file)
@@ -2022,6 +2022,7 @@ NTSTATUS cm_connect_sam(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx,
                goto done;
        }
 
+       TALLOC_FREE(conn->samr_pipe);
 
        /*
         * No SAMR pipe yet. Attempt to get an NTLMSSP SPNEGO authenticated
@@ -2249,6 +2250,8 @@ NTSTATUS cm_connect_lsa(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx,
                goto done;
        }
 
+       TALLOC_FREE(conn->lsa_pipe);
+
        if ((conn->cli->user_name[0] == '\0') ||
            (conn->cli->domain[0] == '\0') || 
            (conn->cli->password == NULL || conn->cli->password[0] == '\0')) {
@@ -2381,6 +2384,8 @@ NTSTATUS cm_connect_netlogon(struct winbindd_domain *domain,
                return NT_STATUS_OK;
        }
 
+       TALLOC_FREE(conn->netlogon_pipe);
+
        result = cli_rpc_pipe_open_noauth(conn->cli,
                                          &ndr_table_netlogon.syntax_id,
                                          &netlogon_pipe);