From: Miroslav Franc Date: Thu, 14 Jul 2016 15:14:08 +0000 (+0200) Subject: fix memory leaks X-Git-Tag: OpenSSL_1_1_0-pre6~221 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=563c1ec61848073e3739dd126cf1950e338c820d;p=oweals%2Fopenssl.git fix memory leaks Reviewed-by: Kurt Roeckx Reviewed-by: Rich Salz (Merged from https://github.com/openssl/openssl/pull/1313) --- diff --git a/crypto/ec/ecp_mont.c b/crypto/ec/ecp_mont.c index a9c6040937..994cc1d0ff 100644 --- a/crypto/ec/ecp_mont.c +++ b/crypto/ec/ecp_mont.c @@ -178,6 +178,7 @@ int ec_GFp_mont_group_set_curve(EC_GROUP *group, const BIGNUM *p, } err: + BN_free(one); BN_CTX_free(new_ctx); BN_MONT_CTX_free(mont); return ret; diff --git a/ssl/ssl_rsa.c b/ssl/ssl_rsa.c index aad65ead89..bb4e872ab4 100644 --- a/ssl/ssl_rsa.c +++ b/ssl/ssl_rsa.c @@ -110,6 +110,7 @@ int SSL_use_RSAPrivateKey(SSL *ssl, RSA *rsa) RSA_up_ref(rsa); if (EVP_PKEY_assign_RSA(pkey, rsa) <= 0) { RSA_free(rsa); + EVP_PKEY_free(pkey); return 0; } @@ -452,6 +453,7 @@ int SSL_CTX_use_RSAPrivateKey(SSL_CTX *ctx, RSA *rsa) RSA_up_ref(rsa); if (EVP_PKEY_assign_RSA(pkey, rsa) <= 0) { RSA_free(rsa); + EVP_PKEY_free(pkey); return 0; }