From 763d39ee64e95801ef972ceba74dd6c8c15b1ea7 Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Sun, 7 Jan 2024 14:10:36 +0100 Subject: irmd: Don't release flow_id before destroying flow When flow_alloc failed, it was releasing the flow_id, but the flow was needs to be cleaned up by the sanitizer. Bug introduced by ongoing refactor of the flow allocator, which - when done - will properly clean up the flow after a failure and not depend on the sanitizer. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- src/irmd/main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/irmd/main.c') diff --git a/src/irmd/main.c b/src/irmd/main.c index 6e7e3d15..20b70a60 100644 --- a/src/irmd/main.c +++ b/src/irmd/main.c @@ -1757,7 +1757,7 @@ static int flow_alloc(pid_t pid, fail_alloc: free(hash); fail_flow: - bmp_release(irmd.flow_ids, flow_id); + /* Sanitize cleans bmp_release(irmd.flow_ids, flow_id); */ fail_ipcp: if (qs.cypher_s > 0) crypt_dh_pkp_destroy(pkp); @@ -2107,7 +2107,6 @@ void * irm_sanitize(void * o) && ts_diff_ms(&f->t0, &now) > IRMD_FLOW_TIMEOUT) { log_dbg("Pending flow_id %d timed out.", f->flow_id); - f->n_pid = -1; reg_flow_set_state(f, FLOW_DEALLOC_PENDING); continue; } -- cgit v1.2.3