From f511a782ab1882a1bd9622fcb57d6640687a3957 Mon Sep 17 00:00:00 2001 From: reshke Date: Fri, 22 Mar 2024 18:42:21 +0500 Subject: [PATCH] Fix router stale lock (#598) --- sources/router.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/router.c b/sources/router.c index 3b1a0b6e9..cb0b7c6fd 100644 --- a/sources/router.c +++ b/sources/router.c @@ -367,8 +367,10 @@ od_router_status_t od_router_route(od_router_t *router, od_client_t *client) salen = sizeof(sa); saddr = (struct sockaddr *)&sa; rc = machine_getpeername(client->io.io, saddr, &salen); - if (rc == -1) + if (rc == -1) { + od_router_unlock(router); return OD_ROUTER_ERROR; + } rule = od_rules_forward(&router->rules, startup->database.value, startup->user.value, &sa, 0); break;