Commit 361e8898 authored by Paul Eggert's avatar Paul Eggert

Fix search_regs memory leak when thread destroyed

* src/thread.c (free_search_regs): New function.
(finalize_one_thread): Use it.
parent 4da44cda
......@@ -768,9 +768,21 @@ run_thread (void *state)
return NULL;
}
static void
free_search_regs (struct re_registers *regs)
{
if (regs->num_regs != 0)
{
xfree (regs->start);
xfree (regs->end);
}
}
void
finalize_one_thread (struct thread_state *state)
{
free_search_regs (&state->m_search_regs);
free_search_regs (&state->m_saved_search_regs);
sys_cond_destroy (&state->thread_condvar);
}
......
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