Skip to content

Commit

Permalink
tee_fs_rpc_opendir(): avoid potential memory leak after early return
Browse files Browse the repository at this point in the history
Fixes: #1960
Signed-off-by: ...your name and email here...
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
  • Loading branch information
viennadd committed Nov 22, 2017
1 parent 24bb751 commit b3b0a4d
Showing 1 changed file with 5 additions and 3 deletions.
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

0 comments on commit b3b0a4d

Please sign in to comment.