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

src: use OnScopeLeave instead of multiple free() #44852

Conversation

tniessen
Copy link
Member

@tniessen tniessen commented Oct 1, 2022

This is not perfect either but it avoids having to call OPENSSL_free() in more than one branch, thus reducing the risk of memory leaks.

This is not great either but it avoids having to call OPENSSL_free() in
more than one branch, thus reducing the risk of memory leaks.
@tniessen tniessen added tls Issues and PRs related to the tls subsystem. crypto Issues and PRs related to the crypto subsystem. c++ Issues and PRs that require attention from people who are familiar with C++. request-ci Add this label to start a Jenkins CI on a PR. labels Oct 1, 2022
@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/crypto

@nodejs-github-bot nodejs-github-bot added the needs-ci PRs that need a full CI run. label Oct 1, 2022
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Oct 1, 2022
Copy link
Contributor

@cjihrig cjihrig left a comment

Choose a reason for hiding this comment

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

The indentation of the ToLocal() on line 1002 looks a little odd, but LGTM

@tniessen
Copy link
Member Author

tniessen commented Oct 1, 2022

The indentation of the ToLocal() on line 1002 looks a little odd, but LGTM

@cjihrig Agreed, but the new-ish format-cpp linter requires this change :/

@tniessen tniessen added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels Oct 1, 2022
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Oct 1, 2022
@tniessen tniessen added the request-ci Add this label to start a Jenkins CI on a PR. label Oct 2, 2022
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Oct 2, 2022
@RaisinTen RaisinTen added the request-ci Add this label to start a Jenkins CI on a PR. label Oct 2, 2022
@tniessen tniessen removed the request-ci Add this label to start a Jenkins CI on a PR. label Oct 2, 2022
@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot
Copy link
Collaborator

@tniessen tniessen added the commit-queue Add this label to land a pull request using GitHub Actions. label Oct 3, 2022
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Oct 3, 2022
@nodejs-github-bot nodejs-github-bot merged commit b5e1387 into nodejs:main Oct 3, 2022
@nodejs-github-bot
Copy link
Collaborator

Landed in b5e1387

TimShilov pushed a commit to TimShilov/node that referenced this pull request Oct 3, 2022
This is not great either but it avoids having to call OPENSSL_free() in
more than one branch, thus reducing the risk of memory leaks.

PR-URL: nodejs#44852
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Daeyeon Jeong <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
panva pushed a commit to panva/node that referenced this pull request Oct 4, 2022
This is not great either but it avoids having to call OPENSSL_free() in
more than one branch, thus reducing the risk of memory leaks.

PR-URL: nodejs#44852
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Daeyeon Jeong <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
danielleadams pushed a commit that referenced this pull request Oct 11, 2022
This is not great either but it avoids having to call OPENSSL_free() in
more than one branch, thus reducing the risk of memory leaks.

PR-URL: #44852
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Daeyeon Jeong <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. c++ Issues and PRs that require attention from people who are familiar with C++. crypto Issues and PRs related to the crypto subsystem. needs-ci PRs that need a full CI run. tls Issues and PRs related to the tls subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants