aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2009-02-07 10:07:06 (GMT)
committerJouni Malinen <j@w1.fi>2009-02-08 10:39:14 (GMT)
commit4e5484fe799d5fc1590673d76ab0a619d9109c19 (patch)
tree5caea3cef8278073b696f20b02fb642c3db79f69 /src
parent28590ed26e001b5b1bd67dc0f7657b8c67b0ee24 (diff)
downloadhostap-06-4e5484fe799d5fc1590673d76ab0a619d9109c19.zip
hostap-06-4e5484fe799d5fc1590673d76ab0a619d9109c19.tar.gz
hostap-06-4e5484fe799d5fc1590673d76ab0a619d9109c19.tar.bz2
Avoid memory leak on error path in crypto_cipher_init()
(cherry picked from commit 7818ad2c8fc544016987cf770f1ef99affd08cb6)
Diffstat (limited to 'src')
-rw-r--r--src/crypto/crypto_openssl.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/crypto/crypto_openssl.c b/src/crypto/crypto_openssl.c
index e02af65..a4c3415 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;
}