]> git.sur5r.net Git - openldap/commitdiff
ITS#7359 cleanup for loop
authorHoward Chu <hyc@openldap.org>
Wed, 22 Aug 2012 21:13:10 +0000 (14:13 -0700)
committerHoward Chu <hyc@openldap.org>
Wed, 22 Aug 2012 21:13:10 +0000 (14:13 -0700)
libraries/libldap/tls_m.c

index 06e61009fba0e79d368fb702a092112e740bc38b..10e6e707d1bca0a8a2d87f8f1bfb4be98626c94d 100644 (file)
@@ -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 );