mirror of
https://github.com/openssl/openssl.git
synced 2025-04-06 20:20:50 +08:00
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:
parent
28e90f69fb
commit
563c1ec618
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user