From 1ed90ac3777d561771bc333b7f40549f83e86240 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Sun, 5 Nov 2017 10:54:50 +0100 Subject: [PATCH] BUG/MAJOR: threads/lb: fix missing unlock on consistent hash LB If no matching node was found, the function was left without unlocking the tree. --- src/lb_chash.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lb_chash.c b/src/lb_chash.c index 32d7d1d11..70a455dc3 100644 --- a/src/lb_chash.c +++ b/src/lb_chash.c @@ -388,9 +388,11 @@ struct server *chash_get_next_server(struct proxy *p, struct server *srvtoavoid) node = eb32_first(root); p->lbprm.chash.last = node; - if (!node) + if (!node) { /* no node is available */ - return NULL; + srv = NULL; + goto out; + } /* Note: if we came here after a down/up cycle with no last * pointer, and after a redispatch (srvtoavoid is set), we