diff options
author | dimitri staessens <[email protected]> | 2017-03-20 13:41:32 +0000 |
---|---|---|
committer | Sander Vrijders <[email protected]> | 2017-03-20 13:41:32 +0000 |
commit | 3bb7ed41f8c96a15f16281f3c9f282e6690aed38 (patch) | |
tree | 47253bfd01c7c42677d292cc7d817d830f0a430c /src/ipcpd/normal/enroll.c | |
parent | 62e725ced1395b161b0fd66aea433c709850cc57 (diff) | |
parent | d14259796288f9d3eae907408b3c9c2e8c750a9c (diff) | |
download | ouroboros-3bb7ed41f8c96a15f16281f3c9f282e6690aed38.tar.gz ouroboros-3bb7ed41f8c96a15f16281f3c9f282e6690aed38.zip |
Merged in dstaesse/ouroboros/be-connmgr (pull request #403)
ipcpd: Fix cleanup of connmgr
Diffstat (limited to 'src/ipcpd/normal/enroll.c')
-rw-r--r-- | src/ipcpd/normal/enroll.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/ipcpd/normal/enroll.c b/src/ipcpd/normal/enroll.c index bdf55fe8..7e15be11 100644 --- a/src/ipcpd/normal/enroll.c +++ b/src/ipcpd/normal/enroll.c @@ -73,15 +73,15 @@ static void * enroll_handle(void * o) (void) o; while (true) { - if (connmgr_wait(enroll.ae, &conn)) { - log_err("Failed to get next connection."); - continue; - } - cdap = cdap_create(); if (cdap == NULL) { log_err("Failed to instantiate CDAP."); - flow_dealloc(conn.flow_info.fd); + continue; + } + + if (connmgr_wait(enroll.ae, &conn)) { + log_err("Failed to get next connection."); + cdap_destroy(cdap); continue; } @@ -179,17 +179,18 @@ int enroll_boot(char * dst_name) char * members_ro = MEMBERS_PATH; char * dif_ro = DIF_PATH; - if (connmgr_alloc(enroll.ae, dst_name, NULL, &conn)) { - log_err("Failed to get connection."); - return -1; - } - cdap = cdap_create(); if (cdap == NULL) { log_err("Failed to instantiate CDAP."); return -1; } + if (connmgr_alloc(enroll.ae, dst_name, NULL, &conn)) { + log_err("Failed to get connection."); + cdap_destroy(cdap); + return -1; + } + if (cdap_add_flow(cdap, conn.flow_info.fd)) { log_warn("Failed to add flow to CDAP."); cdap_destroy(cdap); |