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

Don't set caller information in CRYPTO_[malloc,free] #250

Merged
merged 1 commit into from
Feb 21, 2025
Merged

Conversation

qmuntal
Copy link
Collaborator

@qmuntal qmuntal commented Feb 20, 2025

The CRYPTO_malloc and CRYPTO_free file and line parameters were used in OpenSSL 1 to report memory leaks when calling CRYPTO_mem_leaks.

OpenSSL 3 removed support for the built-in memory leak detections, making CRYPTO_mem_leaks no-op. The recommended way of detecting memory leaks is using LLVM address sanitizers or Valgrind.

We have never used CRYPTO_mem_leaks, and alrady use the recommended way when testing OpenSSL 1, so there is no need to fill the file and line info when calling OpenSSL memory functions. This avoids a call to runtime.Caller, which is strange to see in the middle of a cryptographic function.

@qmuntal qmuntal merged commit 5e4ca0f into v2 Feb 21, 2025
50 checks passed
@qmuntal qmuntal deleted the mallocnocaller branch February 21, 2025 11:05
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