rsa: fix coverity resource leak
@@ -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(
