]> git.ipfire.org Git - thirdparty/strongswan.git/blobdiff - src/libcharon/plugins/stroke/stroke_ca.c
Add a return value to hasher_t.allocate_hash()
[thirdparty/strongswan.git] / src / libcharon / plugins / stroke / stroke_ca.c
index e76560fa217228744a11faba0733cd5f74e5b47e..763b4cc0f3cdeaa625d189fe4664deac6457a818 100644 (file)
@@ -354,10 +354,12 @@ METHOD(stroke_ca_t, check_for_hash_and_url, void,
 
                        if (cert->get_encoding(cert, CERT_ASN1_DER, &encoded))
                        {
-                               hasher->allocate_hash(hasher, encoded, &hash);
-                               section->hashes->insert_last(section->hashes,
+                               if (hasher->allocate_hash(hasher, encoded, &hash))
+                               {
+                                       section->hashes->insert_last(section->hashes,
                                                identification_create_from_encoding(ID_KEY_ID, hash));
-                               chunk_free(&hash);
+                                       chunk_free(&hash);
+                               }
                                chunk_free(&encoded);
                        }
                        break;