]> xenbits.xensource.com Git - qemu-upstream-4.6-testing.git/commitdiff
libcacard/vcard_emul_nss: Drop a redundant conditional
authorMarkus Armbruster <armbru@redhat.com>
Fri, 23 May 2014 11:24:39 +0000 (13:24 +0200)
committerMichael Tokarev <mjt@tls.msk.ru>
Fri, 23 May 2014 20:46:37 +0000 (00:46 +0400)
Bailing out when PK11_FindGenericObjects() returns null ensures the
loop that follows it executes at least once.  The "loop did not
execute" test right after it is useless.  Drop it.

Spotted by Coverity.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
libcacard/vcard_emul_nss.c

index 8e055517f811cb96952928d1906bdb34c1a7f8fe..b7db51df34a04aa17bfca9aceff78800a946094a 100644 (file)
@@ -618,11 +618,6 @@ vcard_emul_mirror_card(VReader *vreader)
         cert_count++;
     }
 
-    if (cert_count == 0) {
-        PK11_DestroyGenericObjects(firstObj);
-        return NULL;
-    }
-
     /* allocate the arrays */
     vcard_emul_alloc_arrays(&certs, &cert_len, &keys, cert_count);