]> git.proxmox.com Git - mirror_frr.git/commitdiff
Need to free the defunct funcname if we grab a thread from the unused list.
authorpaul <paul>
Thu, 27 Mar 2003 23:48:24 +0000 (23:48 +0000)
committerpaul <paul>
Thu, 27 Mar 2003 23:48:24 +0000 (23:48 +0000)
lib/thread.c

index 2a5b806847430504eb8c1354c09db41d0baebec7..402167cf1c750f8f7d9e5574afacc7a6da655eca 100644 (file)
@@ -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;
 }