fix memory leaks

Reviewed-by: Kurt Roeckx <kurt@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1313)
This commit is contained in:
Miroslav Franc 2016-07-14 17:14:08 +02:00 committed by Rich Salz
parent 28e90f69fb
commit 563c1ec618
2 changed files with 3 additions and 0 deletions

View File

@ -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;

View File

@ -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;
}