fixed memleak
authorMartin Willi <martin@strongswan.org>
Mon, 2 Jul 2007 08:33:15 +0000 (08:33 -0000)
committerMartin Willi <martin@strongswan.org>
Mon, 2 Jul 2007 08:33:15 +0000 (08:33 -0000)
src/libstrongswan/asn1/pem.c

index e88db24..6418058 100755 (executable)
@@ -117,8 +117,10 @@ static err_t pem_decrypt(chunk_t *blob, encryption_algorithm_t alg, size_t key_s
        crypter->set_key(crypter, key);
        if (crypter->decrypt(crypter, *blob, *iv, &decrypted) != SUCCESS)
        {
+               crypter->destroy(crypter);
                return "data size is not multiple of block size";
        }
+       crypter->destroy(crypter);
        memcpy(blob->ptr, decrypted.ptr, blob->len);
        chunk_free(&decrypted);