Commit 50aae0007b932e0f62d6842079e1300ed54b6df8

Edward Thomson 2014-10-25T19:52:11

global: clean up openssl_locks on shutdown

diff --git a/src/global.c b/src/global.c
index 514b96c..1e6bf82 100644
--- a/src/global.c
+++ b/src/global.c
@@ -63,8 +63,12 @@ void openssl_locking_function(int mode, int n, const char *file, int line)
 		git_mutex_unlock(&openssl_locks[n]);
 	}
 }
-#endif
 
+static void shutdown_ssl(void)
+{
+	git__free(openssl_locks);
+}
+#endif
 
 static void init_ssl(void)
 {
@@ -112,6 +116,8 @@ static void init_ssl(void)
 
 		CRYPTO_set_locking_callback(openssl_locking_function);
 	}
+
+	git__on_shutdown(shutdown_ssl);
 # endif
 #endif
 }