pkcs11: Use unused return value of C_GetMechanismList
authorrobinleander <rleanderschroeder@gmail.com>
Tue, 27 Mar 2018 20:50:28 +0000 (22:50 +0200)
committerTobias Brunner <tobias@strongswan.org>
Thu, 29 Mar 2018 15:18:27 +0000 (17:18 +0200)
Closes strongswan/strongswan#96.

src/libstrongswan/plugins/pkcs11/pkcs11_library.c

index 89ae196..8d5f4a2 100644 (file)
@@ -899,8 +899,8 @@ METHOD(pkcs11_library_t, create_mechanism_enumerator, enumerator_t*,
                return enumerator_create_empty();
        }
        enumerator->mechs = malloc(sizeof(CK_MECHANISM_TYPE) * enumerator->count);
-       enumerator->lib->f->C_GetMechanismList(slot, enumerator->mechs,
-                                                                                  &enumerator->count);
+       rv = enumerator->lib->f->C_GetMechanismList(slot, enumerator->mechs,
+                                                                                               &enumerator->count);
        if (rv != CKR_OK)
        {
                DBG1(DBG_CFG, "C_GetMechanismList() failed: %N", ck_rv_names, rv);