summaryrefslogtreecommitdiff
path: root/src/ipcpd/normal/fmgr.c
diff options
context:
space:
mode:
authordimitri staessens <dimitri.staessens@intec.ugent.be>2016-08-25 15:54:02 +0200
committerdimitri staessens <dimitri.staessens@intec.ugent.be>2016-08-25 16:16:32 +0200
commitf7777922edd673e43fd670d3d28f052fde2ecc0a (patch)
tree32443ecbb20927b33a6becd50dc6720e4be5b722 /src/ipcpd/normal/fmgr.c
parent6da1fa9716e508d5d15d2953a2c358cfd24c1570 (diff)
downloadouroboros-f7777922edd673e43fd670d3d28f052fde2ecc0a.tar.gz
ouroboros-f7777922edd673e43fd670d3d28f052fde2ecc0a.zip
ipcpd, normal: Safe handling of CDAP requests
Destruction of the object in the reply stage was unsafe.
Diffstat (limited to 'src/ipcpd/normal/fmgr.c')
-rw-r--r--src/ipcpd/normal/fmgr.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/ipcpd/normal/fmgr.c b/src/ipcpd/normal/fmgr.c
index 2e73d71f..3056b46d 100644
--- a/src/ipcpd/normal/fmgr.c
+++ b/src/ipcpd/normal/fmgr.c
@@ -182,8 +182,7 @@ int fmgr_fini()
pthread_cancel(fmgr->listen_thread);
- pthread_join(fmgr->listen_thread,
- NULL);
+ pthread_join(fmgr->listen_thread, NULL);
list_for_each(pos, &fmgr->n_1_flows) {
struct n_1_flow * e =
@@ -194,6 +193,9 @@ int fmgr_fini()
LOG_ERR("Failed to remove management flow.");
}
+ pthread_mutex_destroy(&fmgr->n_1_flows_lock);
+ pthread_mutex_destroy(&fmgr->n_flows_lock);
+
free(fmgr);
return 0;