]> git.ipfire.org Git - thirdparty/strongswan.git/blobdiff - src/libstrongswan/plugins/pgp/pgp_encoder.c
Add a return value to hasher_t.allocate_hash()
[thirdparty/strongswan.git] / src / libstrongswan / plugins / pgp / pgp_encoder.c
index 9043cdb9f3334136224656c1b402920d8b0f85e7..d16d1d71bc611c393b49e0c3a030fffb03327575 100644 (file)
@@ -44,8 +44,12 @@ static bool build_v3_fingerprint(chunk_t *encoding, va_list args)
                {
                        e = chunk_skip(e, 1);
                }
-               hasher->allocate_hash(hasher, n, NULL);
-               hasher->allocate_hash(hasher, e, encoding);
+               if (!hasher->allocate_hash(hasher, n, NULL) ||
+                       !hasher->allocate_hash(hasher, e, encoding))
+               {
+                       hasher->destroy(hasher);
+                       return FALSE;
+               }
                hasher->destroy(hasher);
                return TRUE;
        }