summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDimitri Staessens <dimitri.staessens@ugent.be>2018-05-01 14:03:58 +0200
committerSander Vrijders <sander.vrijders@ugent.be>2018-05-03 10:27:47 +0200
commit5485c380201897792a8e3f49f9b82ff0e99a5369 (patch)
tree50425e1eed3afd93d661f507ad69727dcad93425 /src
parentb047b21e376411a4bda7ed24720feaa9f2a4ecee (diff)
downloadouroboros-5485c380201897792a8e3f49f9b82ff0e99a5369.tar.gz
ouroboros-5485c380201897792a8e3f49f9b82ff0e99a5369.zip
ipcpd: Cleanup pending DHT commands on shutdown
The list of commands was not cleaned up on shutdown. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
Diffstat (limited to 'src')
-rw-r--r--src/ipcpd/normal/dht.c7
1 files changed, 7 insertions, 0 deletions
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);