bliss: Make sure sampler exists after checking for it earlier
authorTobias Brunner <tobias@strongswan.org>
Mon, 15 Dec 2014 17:30:31 +0000 (18:30 +0100)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Tue, 23 Dec 2014 14:40:01 +0000 (15:40 +0100)
src/libstrongswan/plugins/bliss/bliss_private_key.c

index 661b4f8..4f1aeae 100644 (file)
@@ -133,7 +133,7 @@ static bool sign_bliss_with_sha512(private_bliss_private_key_t *this,
 
        /* Create data hash */
        hasher = lib->crypto->create_hasher(lib->crypto, HASH_SHA512);
-       if (!hasher )
+       if (!hasher)
        {
                return FALSE;
        }
@@ -384,7 +384,7 @@ static bool sign_bliss_with_sha512(private_bliss_private_key_t *this,
 
 end:
        /* cleanup */
-       sampler->destroy(sampler);
+       DESTROY_IF(sampler);
        hasher->destroy(hasher);
        sig->destroy(sig);
        fft->destroy(fft);