From: Ondřej Kuzník Date: Fri, 14 Jul 2017 12:47:30 +0000 (+0100) Subject: Do not unlock client unless we are destroying it X-Git-Tag: OPENLDAP_REL_ENG_2_5_1ALPHA~18^2~119 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=96b7619afcfae3322f96ad8b93e8b072f09ec6c2;p=thirdparty%2Fopenldap.git Do not unlock client unless we are destroying it --- diff --git a/servers/lloadd/operation.c b/servers/lloadd/operation.c index 01b4dc3c3d..14bf4bd798 100644 --- a/servers/lloadd/operation.c +++ b/servers/lloadd/operation.c @@ -778,6 +778,7 @@ request_process( Connection *client, Operation *op ) output = upstream->c_pendingber; if ( output == NULL && (output = ber_alloc()) == NULL ) { + rc = -1; goto fail; } upstream->c_pendingber = output; @@ -851,9 +852,8 @@ fail: CONNECTION_LOCK_DECREF(client); op->o_client_refcnt--; operation_destroy_from_client( op ); - CLIENT_UNLOCK_OR_DESTROY(client); - if ( !client ) { - rc = -1; + if ( rc ) { + CLIENT_DESTROY(client); } return rc; }