Commit 8aa707376a4e9dc2b086569f3720901cfef83841

Carlos Martín Nieto 2014-11-17T14:03:50

Merge branch 'openssl-lock-free'

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
diff --git a/src/global.c b/src/global.c
index da903cb..006202a 100644
--- a/src/global.c
+++ b/src/global.c
@@ -67,7 +67,13 @@ void openssl_locking_function(int mode, int n, const char *file, int line)
 
 static void shutdown_ssl_locking(void)
 {
+	int num_locks, i;
+
+	num_locks = CRYPTO_num_locks();
 	CRYPTO_set_locking_callback(NULL);
+
+	for (i = 0; i < num_locks; ++i)
+		git_mutex_free(openssl_locks);
 	git__free(openssl_locks);
 }
 #endif