Blame SOURCES/0017-FAPI-Clean-up-memory-when-Fapi_GetEsysBlob_Async-fai.patch

897056
From f03a243f4f1e249a0f4d96bc5722a44953cad72e Mon Sep 17 00:00:00 2001
897056
From: JerryDevis <857869045@qq.com>
897056
Date: Sun, 9 Jan 2022 18:44:49 +0800
897056
Subject: [PATCH 17/23] FAPI: Clean up memory when Fapi_GetEsysBlob_Async
897056
 failed
897056
897056
Signed-off-by: JerryDevis <857869045@qq.com>
897056
---
897056
 src/tss2-fapi/api/Fapi_GetEsysBlob.c | 8 ++++----
897056
 1 file changed, 4 insertions(+), 4 deletions(-)
897056
897056
diff --git a/src/tss2-fapi/api/Fapi_GetEsysBlob.c b/src/tss2-fapi/api/Fapi_GetEsysBlob.c
897056
index b152ae3a..db67e2e4 100644
897056
--- a/src/tss2-fapi/api/Fapi_GetEsysBlob.c
897056
+++ b/src/tss2-fapi/api/Fapi_GetEsysBlob.c
897056
@@ -157,8 +157,8 @@ Fapi_GetEsysBlob_Async(
897056
     authObject->objectType = IFAPI_OBJ_NONE;
897056
 
897056
     /* Check whether TCTI and ESYS are initialized */
897056
-    return_if_null(context->esys, "Command can't be executed in none TPM mode.",
897056
-                   TSS2_FAPI_RC_NO_TPM);
897056
+    goto_if_null(context->esys, "Command can't be executed in none TPM mode.",
897056
+                   TSS2_FAPI_RC_NO_TPM, error_cleanup);
897056
 
897056
     /* If the async state automata of FAPI shall be tested, then we must not set
897056
        the timeouts of ESYS to blocking mode.
897056
@@ -167,12 +167,12 @@ Fapi_GetEsysBlob_Async(
897056
        to block until a result is available. */
897056
 #ifndef TEST_FAPI_ASYNC
897056
     r = Esys_SetTimeout(context->esys, TSS2_TCTI_TIMEOUT_BLOCK);
897056
-    return_if_error_reset_state(r, "Set Timeout to blocking");
897056
+    goto_if_error_reset_state(r, "Set Timeout to blocking", error_cleanup);
897056
 #endif /* TEST_FAPI_ASYNC */
897056
 
897056
     /* A TPM session will be created to enable object authorization */
897056
     r = ifapi_session_init(context);
897056
-    return_if_error(r, "Initialize GetEsysBlob");
897056
+    goto_if_error(r, "Initialize GetEsysBlob", error_cleanup);
897056
 
897056
     context->state = GET_ESYS_BLOB_GET_FILE;
897056
 
897056
-- 
897056
2.34.3
897056