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

dllmain: Call OpenSSL thread cleanup for Windows and Cygwin #12408

Closed
wants to merge 2 commits into from

Commits on Apr 22, 2024

  1. dllmain: Call OpenSSL thread cleanup for Windows and Cygwin

    - Call OPENSSL_thread_stop on thread termination (DLL_THREAD_DETACH)
      to prevent a memory leak in case OpenSSL is linked statically.
    
    - Warn in libcurl-thread.3 that if OpenSSL is linked statically then it
      may require thread cleanup.
    
    OpenSSL may need per-thread cleanup to stop a memory leak. For Windows
    and Cygwin if libcurl was built as a DLL then we can do that for the
    user by calling OPENSSL_thread_stop on thread termination. However, if
    libcurl was built statically then we do not have notification of thread
    termination and cannot do that for the user.
    
    Also, there are several other unusual cases where it may be necessary
    for the user to call OPENSSL_thread_stop, so in the libcurl-thread
    warning I added a link to the OpenSSL documentation.
    
    Co-authored-by: Viktor Szakats
    
    Reported-by: [email protected]
    Reported-by: [email protected]
    
    Ref: https://www.openssl.org/docs/man3.0/man3/OPENSSL_thread_stop.html#NOTES
    
    Fixes curl#12327
    Closes #xxxx
    jay committed Apr 22, 2024
    Configuration menu
    Copy the full SHA
    9f573f4 View commit details
    Browse the repository at this point in the history
  2. fixup cmake line wrap

    jay committed Apr 22, 2024
    Configuration menu
    Copy the full SHA
    d2a6930 View commit details
    Browse the repository at this point in the history