summaryrefslogtreecommitdiff
path: root/source4/libcli
diff options
context:
space:
mode:
Diffstat (limited to 'source4/libcli')
-rw-r--r--source4/libcli/ldap/ldap_bind.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/source4/libcli/ldap/ldap_bind.c b/source4/libcli/ldap/ldap_bind.c
index f1f7872455..4fdd87a25b 100644
--- a/source4/libcli/ldap/ldap_bind.c
+++ b/source4/libcli/ldap/ldap_bind.c
@@ -377,16 +377,13 @@ NTSTATUS ldap_bind_sasl(struct ldap_connection *conn, struct cli_credentials *cr
ldap_read_io_handler,
conn,
&sasl_socket);
- if (NT_STATUS_IS_OK(status)) {
- talloc_steal(conn->sock, sasl_socket);
- talloc_unlink(conn, conn->sock);
- conn->sock = sasl_socket;
- packet_set_socket(conn->packet, conn->sock);
- } else {
- status = NT_STATUS_NO_MEMORY;
- goto failed;
- }
-
+ if (!NT_STATUS_IS_OK(status)) goto failed;
+
+ talloc_steal(conn->sock, sasl_socket);
+ talloc_unlink(conn, conn->sock);
+ conn->sock = sasl_socket;
+ packet_set_socket(conn->packet, conn->sock);
+
conn->bind.type = LDAP_BIND_SASL;
conn->bind.creds = creds;
}