summaryrefslogtreecommitdiffstats
path: root/lib/thread.c
diff options
context:
space:
mode:
authorpaul <paul>2003-03-27 23:48:24 +0000
committerpaul <paul>2003-03-27 23:48:24 +0000
commit1407402ec7217a599ba0514bfe1a395be32fb84c (patch)
tree790dbbf3142fef653a046d20237deb0e64e844d8 /lib/thread.c
parent6b81f08ccb20b159c01a7bf4516755b30868fea6 (diff)
downloadquagga-1407402ec7217a599ba0514bfe1a395be32fb84c.tar.bz2
quagga-1407402ec7217a599ba0514bfe1a395be32fb84c.tar.xz
Need to free the defunct funcname if we grab a thread from the unused list.
Diffstat (limited to 'lib/thread.c')
-rw-r--r--lib/thread.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/thread.c b/lib/thread.c
index 2a5b8068..402167cf 100644
--- a/lib/thread.c
+++ b/lib/thread.c
@@ -414,7 +414,11 @@ thread_get (struct thread_master *m, u_char type,
struct thread *thread;
if (m->unuse.head)
- thread = thread_trim_head (&m->unuse);
+ {
+ thread = thread_trim_head (&m->unuse);
+ if (thread->funcname)
+ XFREE(MTYPE_STRVEC, thread->funcname);
+ }
else
{
thread = XCALLOC (MTYPE_THREAD, sizeof (struct thread));
@@ -852,5 +856,7 @@ funcname_thread_execute (struct thread_master *m,
dummy.funcname = strip_funcname (funcname);
thread_call (&dummy);
+ XFREE (MTYPE_STRVEC, dummy.funcname);
+
return NULL;
}