Merge "[Bugfix][T108][bug-view-1825]Fix the issue of probability crash when reading data fails" into GSW_V1453
diff --git a/mbtk/libgsw_lib/gsw_secrypt_ss_interface.c b/mbtk/libgsw_lib/gsw_secrypt_ss_interface.c
index 6013227..7447fc5 100755
--- a/mbtk/libgsw_lib/gsw_secrypt_ss_interface.c
+++ b/mbtk/libgsw_lib/gsw_secrypt_ss_interface.c
@@ -279,8 +279,10 @@
TEEC_Result res = read_secure_object(&ctx, in_obj_name, tmp_buf, &size);
if (res != TEEC_SUCCESS)
{
- LOGE("Failed to read an object from the secure storage");
+ LOGE("Failed to read an object from the secure storage");
ret = GSW_HAL_NORMAL_FAIL;
+ free(tmp_buf);
+ return ret;
}
LOGE("really start end\n");
memcpy(out_buf, tmp_buf, size);