From b23e3024d12c28b01426cc37d5adf03f9c1bea88 Mon Sep 17 00:00:00 2001 From: dimitri staessens Date: Sun, 23 Oct 2016 23:00:15 +0200 Subject: lib: Stabilise flow allocation Deallocation was reverted to a synchronoous operation between the AP, IRMd and IPCP in order to avoid inconsistent states of the port_id. Fixes some memory leaks, particularly the shm_flow_set is now closed upon deallocation. --- src/irmd/main.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/irmd') diff --git a/src/irmd/main.c b/src/irmd/main.c index 390681a8..3884a9a7 100644 --- a/src/irmd/main.c +++ b/src/irmd/main.c @@ -1929,10 +1929,9 @@ void * mainloop(void * o) ret_msg.result = flow_alloc_res(msg->port_id); break; case IRM_MSG_CODE__IRM_FLOW_DEALLOC: - flow_dealloc(msg->api, msg->port_id); - irm_msg__free_unpacked(msg, NULL); - close(cli_sockfd); - continue; + ret_msg.has_result = true; + ret_msg.result = flow_dealloc(msg->api, msg->port_id); + break; case IRM_MSG_CODE__IPCP_FLOW_REQ_ARR: e = flow_req_arr(msg->api, msg->dst_name, -- cgit v1.2.3