Coverity 1458439: fix resource leak
authorPauli <paul.dale@oracle.com>
Sun, 16 Feb 2020 07:58:45 +0000 (17:58 +1000)
committerPauli <paul.dale@oracle.com>
Mon, 17 Feb 2020 09:29:04 +0000 (19:29 +1000)
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/11101)

providers/implementations/asymciphers/rsa_enc.c

index 2cce847..87349ed 100644 (file)
@@ -119,6 +119,7 @@ static int rsa_encrypt(void *vprsactx, unsigned char *out, size_t *outlen,
             return 0;
         }
         if (prsactx->oaep_md == NULL) {
+            OPENSSL_free(tbuf);
             prsactx->oaep_md = EVP_MD_fetch(prsactx->libctx, "SHA-1", NULL);
             PROVerr(0, ERR_R_INTERNAL_ERROR);
             return 0;