Hans Leidekker : winhttp: Clean up locks after closing libssl and libcrypto .

Alexandre Julliard julliard at winehq.org
Tue Oct 27 09:46:30 CDT 2009


Module: wine
Branch: master
Commit: 629fd8fcbca495ce8b8d5cd91e76299b5422fe94
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=629fd8fcbca495ce8b8d5cd91e76299b5422fe94

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Tue Oct 27 10:04:05 2009 +0100

winhttp: Clean up locks after closing libssl and libcrypto.

SSL_CTX_free() triggers a call to the locking callback.
Found by valgrind.

---

 dlls/winhttp/net.c |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/dlls/winhttp/net.c b/dlls/winhttp/net.c
index 28b3972..53911d6 100644
--- a/dlls/winhttp/net.c
+++ b/dlls/winhttp/net.c
@@ -316,13 +316,6 @@ void netconn_unload( void )
 #if defined(SONAME_LIBSSL) && defined(SONAME_LIBCRYPTO)
     if (libcrypto_handle)
     {
-        if (ssl_locks)
-        {
-            int i;
-
-            for (i = 0; i < num_ssl_locks; i++) DeleteCriticalSection( &ssl_locks[i] );
-            HeapFree( GetProcessHeap(), 0, ssl_locks );
-        }
         wine_dlclose( libcrypto_handle, NULL, 0 );
     }
     if (libssl_handle)
@@ -331,6 +324,12 @@ void netconn_unload( void )
             pSSL_CTX_free( ctx );
         wine_dlclose( libssl_handle, NULL, 0 );
     }
+    if (ssl_locks)
+    {
+        int i;
+        for (i = 0; i < num_ssl_locks; i++) DeleteCriticalSection( &ssl_locks[i] );
+        HeapFree( GetProcessHeap(), 0, ssl_locks );
+    }
 #endif
 }
 




More information about the wine-cvs mailing list