pkcs11: Properly destroy mutex in pkcs11_hasher if no token found.
authorTobias Brunner <tobias@strongswan.org>
Mon, 24 Oct 2011 14:36:55 +0000 (16:36 +0200)
committerTobias Brunner <tobias@strongswan.org>
Mon, 31 Oct 2011 17:45:29 +0000 (18:45 +0100)
src/libstrongswan/plugins/pkcs11/pkcs11_hasher.c

index 5da9700..069fa98 100644 (file)
@@ -315,6 +315,7 @@ pkcs11_hasher_t *pkcs11_hasher_create(hash_algorithm_t algo)
        this->lib = find_token(algo, &this->session, &this->mech, &this->size);
        if (!this->lib)
        {
+               this->mutex->destroy(this->mutex);
                free(this);
                return NULL;
        }