[PATCH] irmd: Cleanup flow datastructures on exit

  • From: Dimitri Staessens <dimitri.staessens@xxxxxxxx>
  • To: ouroboros@xxxxxxxxxxxxx
  • Date: Sat, 24 Feb 2018 20:05:59 +0100

The irmd was not cleaning up non-deallocated flows upon exit. This bug
was probably introduced with the introduction of the threadpool
managers.

Signed-off-by: Dimitri Staessens <dimitri.staessens@xxxxxxxx>
---
 src/irmd/main.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/irmd/main.c b/src/irmd/main.c
index 64c9efc..3b09361 100644
--- a/src/irmd/main.c
+++ b/src/irmd/main.c
@@ -1599,6 +1599,12 @@ static void irm_fini(void)
 
         registry_destroy(&irmd.registry);
 
+        list_for_each_safe(p, h, &irmd.irm_flows) {
+                struct irm_flow * f = list_entry(p, struct irm_flow, next);
+                list_del(&f->next);
+                irm_flow_destroy(f);
+        }
+
         pthread_rwlock_unlock(&irmd.reg_lock);
 
         if (irmd.rdrb != NULL)
-- 
2.16.2


Other related posts: