Skip to content
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: 6 additions & 2 deletions secure_storage/ta/secure_storage_ta.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,10 @@ static TEE_Result create_raw_object(uint32_t param_types, TEE_Param params[4])

data_sz = params[1].memref.size;
data = TEE_Malloc(data_sz, 0);
if (!data)
if (!data) {
TEE_Free(obj_id);
return TEE_ERROR_OUT_OF_MEMORY;
}
TEE_MemMove(data, params[1].memref.buffer, data_sz);

/*
Expand Down Expand Up @@ -173,8 +175,10 @@ static TEE_Result read_raw_object(uint32_t param_types, TEE_Param params[4])

data_sz = params[1].memref.size;
data = TEE_Malloc(data_sz, 0);
if (!data)
if (!data) {
TEE_Free(obj_id);
return TEE_ERROR_OUT_OF_MEMORY;
}

/*
* Check the object exist and can be dumped into output buffer
Expand Down