diff options
author | Dimitri Staessens <dimitri.staessens@ugent.be> | 2018-05-01 14:03:58 +0200 |
---|---|---|
committer | Sander Vrijders <sander.vrijders@ugent.be> | 2018-05-03 10:27:47 +0200 |
commit | 5485c380201897792a8e3f49f9b82ff0e99a5369 (patch) | |
tree | 50425e1eed3afd93d661f507ad69727dcad93425 /src/ipcpd | |
parent | b047b21e376411a4bda7ed24720feaa9f2a4ecee (diff) | |
download | ouroboros-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/ipcpd')
-rw-r--r-- | src/ipcpd/normal/dht.c | 7 |
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); |