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

Fix Memory Leak in serialize_indirect_attribute() #390

Merged
merged 1 commit into from
Sep 24, 2024

Conversation

hoyong2007
Copy link
Contributor

Add release_serial_object(obj2) to release obj2
before serialize_indirect_attribute() returns to
prevent memory leakage.

@hoyong2007
Copy link
Contributor Author

This is a PR for issue #387

Copy link
Contributor

@etienne-lms etienne-lms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you format the commit message in a more standard way? A header line (74 char/max, starting with libckteec: + a short description + your Signed-off-by: tag. Please also add a Link: tag to reference the Issue entry this change fixes, as well as a Fixes: tag referencing the faulty commit. Something like:

libckteec: fix memory allocation leakage on template serialization

Fix memory allocation leakage with a call to release_serial_object()
to release obj2 before serialize_indirect_attribute() returns.

Link: https://github.com/OP-TEE/optee_client/issues/387
Fixes: e88c264ba358 ("libckteec: helper function to serialize a attribute template")
Signed-off-by: REAL-NAME <E-MAIL-ADDRESS>

There are few indications in the contribution documentation. See also the other commits in optee_client.git history.

libckteec/src/serialize_ck.c Show resolved Hide resolved
@etienne-lms
Copy link
Contributor

Thanks for the fix. Could you squash the 2 commits into a single one.
You can apply my R-b tag: Reviewed-by: Etienne Carriere <[email protected]>.

@etienne-lms
Copy link
Contributor

@jforissier, could you enable CT tests for this P-R?

Fix memory allocation leakage with a call to release_serial_object()
to release obj2 before serialize_indirect_attribute() returns.

Link: OP-TEE#387
Fixes: e88c264 ("libckteec: helper function to serialize a attribute template")
Signed-off-by: Hoyong Jin <[email protected]>
Reviewed-by: Etienne Carriere <[email protected]>
@etienne-lms
Copy link
Contributor

Looks all good to me.
@jforissier, could you enable CI tests for this change?

@jforissier
Copy link
Contributor

@jforissier, could you enable CT tests for this P-R?

Sure, done.

Copy link
Contributor

@etienne-lms etienne-lms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.
All good. Ready to merge.

@jforissier jforissier merged commit 49e646d into OP-TEE:master Sep 24, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants