From 1ebf95c31b11344fe48581e718d14f7a261cee10 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Wed, 22 Aug 2012 14:13:10 -0700 Subject: [PATCH] ITS#7359 cleanup for loop --- libraries/libldap/tls_m.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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 ); -- 2.39.5