summaryrefslogtreecommitdiff
path: root/src/global.c
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2015-10-02 03:43:11 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2015-11-12 17:18:42 +0100
commitde870533e02505f3868403dabd7699da01e4ceda (patch)
tree620ac16e1abe76f4fd5d19fb8fb2ed65604f6570 /src/global.c
parent1c34b717e0962971afe28139c3a44b3f5733cff2 (diff)
downloadlibgit2-de870533e02505f3868403dabd7699da01e4ceda.tar.gz
settings: add a setter for a custom user-agent
Diffstat (limited to 'src/global.c')
-rw-r--r--src/global.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/global.c b/src/global.c
index 3d37ee4de..0eab8d552 100644
--- a/src/global.c
+++ b/src/global.c
@@ -31,6 +31,7 @@ static git_mutex *openssl_locks;
static git_global_shutdown_fn git__shutdown_callbacks[MAX_SHUTDOWN_CB];
static git_atomic git__n_shutdown_callbacks;
static git_atomic git__n_inits;
+char *git__user_agent;
void git__on_shutdown(git_global_shutdown_fn callback)
{
@@ -269,6 +270,8 @@ int git_libgit2_shutdown(void)
git_win32__crtdbg_stacktrace_cleanup();
git_win32__stack_cleanup();
#endif
+
+ git__free(git__user_agent);
}
/* Exit the lock */
@@ -369,6 +372,7 @@ int git_libgit2_shutdown(void)
git__global_state_cleanup(ptr);
git__free(ptr);
+ git__free(git__user_agent);
pthread_key_delete(_tls_key);
git_mutex_free(&git__mwindow_mutex);
@@ -423,6 +427,7 @@ int git_libgit2_shutdown(void)
git__shutdown();
git__global_state_cleanup(&__state);
uninit_ssl();
+ git__free(git__user_agent);
return 0;
}