Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid the potential memory leak after early return. #1961

Merged
merged 1 commit into from
Nov 23, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions core/tee/tee_fs_rpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -376,12 +376,14 @@ TEE_Result tee_fs_rpc_opendir(uint32_t id, const TEE_UUID *uuid,
op.params[0].u.value.a = OPTEE_MRF_OPENDIR;

if (!msg_param_init_memparam(op.params + 1, mobj, 0, TEE_FS_NAME_MAX,
cookie, MSG_PARAM_MEM_DIR_IN))
return TEE_ERROR_BAD_STATE;
cookie, MSG_PARAM_MEM_DIR_IN)) {
res = TEE_ERROR_BAD_STATE;
goto err_exit;
}

res = tee_svc_storage_create_dirname(va, TEE_FS_NAME_MAX, uuid);
if (res != TEE_SUCCESS)
return res;
goto err_exit;

op.params[2].attr = OPTEE_MSG_ATTR_TYPE_VALUE_OUTPUT;

Expand Down