Skip to content

Revert "Fix memory leak in rs256_from_coords" #162

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

djw8605
Copy link
Contributor

@djw8605 djw8605 commented Jun 26, 2025

This reverts commit d0bf032.

Found with git bisect. Only occurs on el8. Likely an change in OpenSSL behavior?

Comment on lines +535 to +536
e_bignum.release();
n_bignum.release();
Copy link
Contributor

Choose a reason for hiding this comment

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

It sure is counter intuitive that adding back releases will fix a free() error, or for that matter deleting them in the original PR fixed a memory leak. One would think the opposite, that calling release() could fix a memory leak and removing it could fix a double-free error.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since those variables are unique_ptr, release() in this context actually means for the unique_ptr to stop managing the pointer. So, effectively, it's leaking memory. But really, it must be passing it over to OpenSSL library somewhere.

Sometimes I am envious of memory safe languages like go, or the ownership mechanics of rust.

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.

2 participants