diff options
author | Pauli <ppzgs1@gmail.com> | 2021-03-18 12:59:40 +1000 |
---|---|---|
committer | Pauli <ppzgs1@gmail.com> | 2021-03-20 10:08:00 +1000 |
commit | bca681aa5b2539c1e50072a2034ef2f5414bb61c (patch) | |
tree | 8d63e509a67fdb24704069376cfdfe629bf1312f /providers | |
parent | 7153f544378eea343c61446c8fc844ae3417ca84 (diff) |
rsa: fix coverity 1472658: resource leak
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14596)
Diffstat (limited to 'providers')
-rw-r--r-- | providers/implementations/asymciphers/rsa_enc.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/providers/implementations/asymciphers/rsa_enc.c b/providers/implementations/asymciphers/rsa_enc.c index 34ce13dd30..621239d79e 100644 --- a/providers/implementations/asymciphers/rsa_enc.c +++ b/providers/implementations/asymciphers/rsa_enc.c @@ -250,6 +250,7 @@ static int rsa_decrypt(void *vprsactx, unsigned char *out, size_t *outlen, if (prsactx->oaep_md == NULL) { prsactx->oaep_md = EVP_MD_fetch(prsactx->libctx, "SHA-1", NULL); if (prsactx->oaep_md == NULL) { + OPENSSL_free(tbuf); ERR_raise(ERR_LIB_PROV, ERR_R_INTERNAL_ERROR); return 0; } @@ -264,6 +265,7 @@ static int rsa_decrypt(void *vprsactx, unsigned char *out, size_t *outlen, /* RSA_PKCS1_WITH_TLS_PADDING */ if (prsactx->client_version <= 0) { ERR_raise(ERR_LIB_PROV, PROV_R_BAD_TLS_CLIENT_VERSION); + OPENSSL_free(tbuf); return 0; } ret = ossl_rsa_padding_check_PKCS1_type_2_TLS( |