From: Howard Chu Date: Wed, 22 Aug 2012 21:13:10 +0000 (-0700) Subject: ITS#7359 cleanup for loop X-Git-Tag: OPENLDAP_REL_ENG_2_4_33~40 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=9905113e8e11d771b63bc5ec79432211a4faaf1c;p=openldap ITS#7359 cleanup for loop --- diff --git a/libraries/libldap/tls_m.c b/libraries/libldap/tls_m.c index 06e61009fb..10e6e707d1 100644 --- a/libraries/libldap/tls_m.c +++ b/libraries/libldap/tls_m.c @@ -1010,12 +1010,12 @@ tlsm_find_unlocked_key( tlsm_ctx *ctx, void *pin_arg ) } PK11SlotListElement *le; - for ( le = slots->head; le && !result; le = le->next ) { + for ( le = slots->head; le; le = le->next ) { PK11SlotInfo *slot = le->slot; - if ( !PK11_IsLoggedIn( slot, NULL ) ) - continue; - - result = PK11_FindKeyByDERCert( slot, ctx->tc_certificate, pin_arg ); + if ( PK11_IsLoggedIn( slot, NULL ) ) { + result = PK11_FindKeyByDERCert( slot, ctx->tc_certificate, pin_arg ); + break; + } } PK11_FreeSlotList( slots );