From 5485c380201897792a8e3f49f9b82ff0e99a5369 Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Tue, 1 May 2018 14:03:58 +0200 Subject: ipcpd: Cleanup pending DHT commands on shutdown The list of commands was not cleaned up on shutdown. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- src/ipcpd/normal/dht.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/ipcpd/normal/dht.c b/src/ipcpd/normal/dht.c index 6d291a35..affec434 100644 --- a/src/ipcpd/normal/dht.c +++ b/src/ipcpd/normal/dht.c @@ -2625,6 +2625,13 @@ void dht_destroy(struct dht * dht) pthread_rwlock_wrlock(&dht->lock); + list_for_each_safe(p, h, &dht->cmds) { + struct cmd * c = list_entry(p, struct cmd, next); + list_del(&c->next); + ipcp_sdb_release(c->sdb); + free(c); + } + list_for_each_safe(p, h, &dht->entries) { struct dht_entry * e = list_entry(p, struct dht_entry, next); list_del(&e->next); -- cgit v1.2.3