Skip to content

Fix memory leak computing ECDH secrets#413

Merged
jasonkatonica merged 1 commit intoIBM:java21from
jasonkatonica:katonica/issue387/computeecdhsecretleak21
Jan 8, 2025
Merged

Fix memory leak computing ECDH secrets#413
jasonkatonica merged 1 commit intoIBM:java21from
jasonkatonica:katonica/issue387/computeecdhsecretleak21

Conversation

@jasonkatonica
Copy link
Member

@jasonkatonica jasonkatonica commented Jan 3, 2025

The context allocated in the method XECKEY.computeECDHSecret was never freed when a key was successfully generated. This update frees memory associated with the context prior to return of the secret key bytes.

Whitespace and formatting was also done to make use of brackets for if statements.

Back-ported from: #393

Fixes #387

Signed-off-by: Jason Katonica katonica@us.ibm.com

The context allocated in the method `XECKEY.computeECDHSecret` was never
freed when a key was successfully generated. This update frees memory
associated with the context prior to return of the secret key bytes.

Whitespace and formatting was also done to make use of brackets for if
statements.

Fixes IBM#387

Signed-off-by: Jason Katonica <katonica@us.ibm.com>
Copy link
Collaborator

@taoliult taoliult left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@KostasTsiounis KostasTsiounis left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@JinhangZhang JinhangZhang left a comment

Choose a reason for hiding this comment

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

LGTM

@jasonkatonica jasonkatonica merged commit 1bfb8b8 into IBM:java21 Jan 8, 2025
2 checks passed
@jasonkatonica jasonkatonica deleted the katonica/issue387/computeecdhsecretleak21 branch January 8, 2025 18:27
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.

5 participants