mem-cred: We don't need a write lock when looking for a certificate
authorTobias Brunner <tobias@strongswan.org>
Thu, 20 Aug 2015 13:11:02 +0000 (15:11 +0200)
committerTobias Brunner <tobias@strongswan.org>
Thu, 20 Aug 2015 17:19:37 +0000 (19:19 +0200)
src/libstrongswan/credentials/sets/mem_cred.c

index a16767c..4884c4b 100644 (file)
@@ -197,7 +197,7 @@ METHOD(mem_cred_t, get_cert_ref, certificate_t*,
 {
        certificate_t *cached;
 
-       this->lock->write_lock(this->lock);
+       this->lock->read_lock(this->lock);
        if (this->untrusted->find_first(this->untrusted,
                                                                        (linked_list_match_t)certificate_equals,
                                                                        (void**)&cached, cert) == SUCCESS)