Skip to content

Commit

Permalink
fix #276: double-free panic in gcc attribute destructor logging
Browse files Browse the repository at this point in the history
  • Loading branch information
tsemo4917 authored and deemar committed Nov 5, 2024
1 parent 54e4306 commit ee835a1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/zlog.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,18 @@ static void zlog_fini_inner(void)

static void zlog_clean_rest_thread(void)
{
int rc;

zlog_thread_t *a_thread;
a_thread = pthread_getspecific(zlog_thread_key);
if (!a_thread) return;
zlog_thread_del(a_thread);

rc = pthread_setspecific(zlog_thread_key, NULL);
if (rc) {
zc_error("pthread_setspecific fail, rc[%d]", rc);
return;
}
return;
}

Expand Down

0 comments on commit ee835a1

Please sign in to comment.