From: Howard Chu Date: Wed, 22 Aug 2012 21:13:10 +0000 (-0700) Subject: ITS#7359 cleanup for loop X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=1ebf95c31b11344fe48581e718d14f7a261cee10;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 );