-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Fix memory leak (start enum) #497
Fix memory leak (start enum) #497
Conversation
@@ -978,6 +978,7 @@ TEE_Result tee_svc_storage_start_enum(uint32_t obj_enum, uint32_t storage_id) | |||
if (res != TEE_SUCCESS) | |||
goto exit; | |||
res = tee_obj_verify(sess, o); | |||
free(o->pobj->obj_id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The need for this free is a bit obscure, please add a comment explaining why it's needed here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
I think you should add 'Fixes #494' to the commit log. |
Update commit message. |
53e82ad
to
ac23c78
Compare
Update. |
|
PR#497 ("Fix memory leak (start enum)") OP-TEE/optee_os#497 Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
@@ -980,6 +980,8 @@ TEE_Result tee_svc_storage_start_enum(uint32_t obj_enum, uint32_t storage_id) | |||
res = tee_obj_verify(sess, o); | |||
if (res != TEE_SUCCESS) | |||
goto exit; | |||
free(o->pobj->obj_id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The need for this free is a bit obscure, please add a comment explaining why it's needed here.
ac23c78
to
4ab88b9
Compare
@jenswi-linaro : Add comments in the code. Is it OK with you ? |
I'm not sure that 'Fix#494' in the commit log will be recognized by GitHub for linking and closing the issue automatically, see https://help.github.com/articles/closing-issues-via-commit-messages/ |
|
@cedric-chaumont-st-dev you have modified the patch after I have tested it (you changed the code structure) and still you are keeping my |
555127c
to
4a893a4
Compare
updated |
|
Enumeration loop added for object corruption. Add missing free because of tee_svc_storage_set_enum obj_id memory allocation (malloc) during enumeration loop. Force obj_id to NULL in the enumation loop to skip freeing at 'exit' label statement. closes OP-TEE#494 Signed-off-by: Cedric Chaumont <cedric.chaumont@st.com> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Pascal Brand <pascal.brand@linaro.org> Tested-by: Cedric Chaumont <cedric.chaumont@linaro.org> (STM boards) Tested-by: Cedric Chaumont <cedric.chaumont@linaro.org> (ARM Juno board) Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (HiKey)
4a893a4
to
35ade1d
Compare
Update commit message. Verified (STM board, ARM Juno) |
Signed-off-by: Cedric Chaumont cedric.chaumont@st.com
Tested-by: Cedric Chaumont cedric.chaumont@linaro.org (STM boards)