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