Blame SOURCES/0009-FAPI-Fix-leak-in-fapi-crypto-with-ossl3.patch

6a14f3
From e1b4d9fd5b796711b38475c381a168a99003163c Mon Sep 17 00:00:00 2001
6a14f3
From: Juergen Repp <juergen.repp@sit.fraunhofer.de>
6a14f3
Date: Thu, 2 Dec 2021 09:17:15 +0100
6a14f3
Subject: [PATCH 09/23] FAPI: Fix leak in fapi crypto with ossl3
6a14f3
6a14f3
A leak in the case "out of memory" detected by scan-build was fixed.
6a14f3
6a14f3
Signed-off-by: Juergen Repp <juergen.repp@sit.fraunhofer.de>
6a14f3
---
6a14f3
 src/tss2-fapi/fapi_crypto.c | 2 +-
6a14f3
 1 file changed, 1 insertion(+), 1 deletion(-)
6a14f3
6a14f3
diff --git a/src/tss2-fapi/fapi_crypto.c b/src/tss2-fapi/fapi_crypto.c
6a14f3
index d061cf48..fd7ea555 100644
6a14f3
--- a/src/tss2-fapi/fapi_crypto.c
6a14f3
+++ b/src/tss2-fapi/fapi_crypto.c
6a14f3
@@ -1573,7 +1573,7 @@ ifapi_crypto_hash_start(IFAPI_CRYPTO_CONTEXT_BLOB **context,
6a14f3
      * As we don't want the TPM to be called for these operations, we have
6a14f3
      * to initialize own library context with the default provider. */
6a14f3
     mycontext->libctx = OSSL_LIB_CTX_new();
6a14f3
-    return_if_null(mycontext->libctx, "Out of memory", TSS2_FAPI_RC_MEMORY);
6a14f3
+    goto_if_null(mycontext->libctx, "Out of memory", TSS2_FAPI_RC_MEMORY, cleanup);
6a14f3
 
6a14f3
     if (!(mycontext->osslHashAlgorithm =
6a14f3
             EVP_MD_fetch(mycontext->libctx, get_hash_md(hashAlgorithm), NULL))) {
6a14f3
-- 
6a14f3
2.34.3
6a14f3