summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2014-10-25 19:52:11 -0400
committerEdward Thomson <ethomson@microsoft.com>2014-10-26 22:27:52 -0400
commit50aae0007b932e0f62d6842079e1300ed54b6df8 (patch)
tree154c72aaecb0089d86522e1afaf61baebcdcc753
parent16288d2db3a303ef6a6fafcd8631567721ea6ddb (diff)
downloadlibgit2-50aae0007b932e0f62d6842079e1300ed54b6df8.tar.gz
global: clean up openssl_locks on shutdown
-rw-r--r--src/global.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/global.c b/src/global.c
index 514b96ccb..1e6bf82f9 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
}