botan: Fix leak if hasher initialization fails
authorTobias Brunner <tobias@strongswan.org>
Mon, 17 Sep 2018 15:59:55 +0000 (17:59 +0200)
committerTobias Brunner <tobias@strongswan.org>
Mon, 17 Sep 2018 16:51:41 +0000 (18:51 +0200)
src/libstrongswan/plugins/botan/botan_hasher.c

index 3a8fcd8..d574db0 100644 (file)
@@ -129,6 +129,7 @@ botan_hasher_t *botan_hasher_create(hash_algorithm_t algo)
 
        if (botan_hash_init(&this->hash, hash_name, 0))
        {
+               free(this);
                return NULL;
        }
        return &this->public;