From 7818ad2c8fc544016987cf770f1ef99affd08cb6 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sat, 7 Feb 2009 12:07:06 +0200 Subject: [PATCH] Avoid memory leak on error path in crypto_cipher_init() --- src/crypto/crypto_openssl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/crypto/crypto_openssl.c b/src/crypto/crypto_openssl.c index e02af65c2..a4c3415c4 100644 --- a/src/crypto/crypto_openssl.c +++ b/src/crypto/crypto_openssl.c @@ -283,6 +283,7 @@ struct crypto_cipher * crypto_cipher_init(enum crypto_cipher_alg alg, cipher = EVP_aes_256_cbc(); break; default: + os_free(ctx); return NULL; } break; @@ -301,6 +302,7 @@ struct crypto_cipher * crypto_cipher_init(enum crypto_cipher_alg alg, break; #endif /* OPENSSL_NO_RC2 */ default: + os_free(ctx); return NULL; }