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 TlsRandomNumberGenerator() constructor #2660 #2661

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

Conversation

hongweipeng
Copy link

@hongweipeng hongweipeng commented May 7, 2024

Fixes #2660

Changes

Please provide a brief description of the changes here.

For significant contributions please make sure you have completed the following items:

  • CHANGELOG.md updated for non-trivial changes
  • Unit tests have been added
  • Changes in public API reviewed

@hongweipeng hongweipeng requested a review from a team as a code owner May 7, 2024 07:26
Copy link

linux-foundation-easycla bot commented May 7, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: hongweipeng / name: Weipeng Hong (6b44492)

@marcalff marcalff added the pr:waiting-on-cla Waiting on CLA label May 7, 2024
@marcalff marcalff removed the pr:waiting-on-cla Waiting on CLA label May 7, 2024
@hongweipeng hongweipeng force-pushed the fix-random-memory-leak branch 3 times, most recently from cdffe88 to 9ebc698 Compare May 8, 2024 04:02
@@ -26,12 +27,17 @@ class TlsRandomNumberGenerator
TlsRandomNumberGenerator() noexcept
{
Seed();
platform::AtFork(nullptr, nullptr, OnFork);
if (!flag.test_and_set())
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it possible to add a test for this?

Copy link
Author

Choose a reason for hiding this comment

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

Hello, unit test has been added.

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.

TlsRandomNumberGenerator() can cause memory leaks
3 participants