From 45a1a6d68af7a22a13f046855c59329221667448 Mon Sep 17 00:00:00 2001 From: Jan Zeleny Date: Fri, 11 Mar 2011 11:51:34 -0500 Subject: Fix one unlikely case of failure in sdap_id_op module There can be an unlikely scenario when the first part of sdap_id_op_connect_done works fine and there is no need to mark backend offline. But right after the check, the memory allocation can fail in which case the backend needs to be marked offline along with disabled reconnecting. --- src/providers/ldap/sdap_id_op.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/providers/ldap/sdap_id_op.c b/src/providers/ldap/sdap_id_op.c index c38a803ff..6933b2bb2 100644 --- a/src/providers/ldap/sdap_id_op.c +++ b/src/providers/ldap/sdap_id_op.c @@ -522,7 +522,7 @@ static void sdap_id_op_connect_done(struct tevent_req *subreq) /* be is going offline as there is no more servers to try */ DEBUG(1, ("Failed to connect, going offline (%d [%s])\n", ret, strerror(ret))); - be_mark_offline(conn_data->conn_cache->id_ctx->be); + be_mark_offline(conn_cache->id_ctx->be); is_offline = true; } @@ -544,6 +544,8 @@ static void sdap_id_op_connect_done(struct tevent_req *subreq) default: /* do not attempt to retry on errors like ENOMEM */ can_retry = false; + is_offline = true; + be_mark_offline(conn_cache->id_ctx->be); break; } } -- cgit