Commit 3a8b69d1 by Leo Yang Committed by Carlos Martín Nieto

Fix leak of TLS error message in shutdown (ptherad version)

parent 814d86bf
...@@ -263,9 +263,7 @@ int init_error = 0; ...@@ -263,9 +263,7 @@ int init_error = 0;
static void cb__free_status(void *st) static void cb__free_status(void *st)
{ {
git_global_st *state = (git_global_st *) st; giterr_clear();
git__free(state->error_t.message);
git__free(st); git__free(st);
} }
...@@ -308,6 +306,8 @@ int git_libgit2_shutdown(void) ...@@ -308,6 +306,8 @@ int git_libgit2_shutdown(void)
/* Shut down any subsystems that have global state */ /* Shut down any subsystems that have global state */
git__shutdown(); git__shutdown();
giterr_clear();
ptr = pthread_getspecific(_tls_key); ptr = pthread_getspecific(_tls_key);
pthread_setspecific(_tls_key, NULL); pthread_setspecific(_tls_key, NULL);
git__free(ptr); git__free(ptr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment