]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MAJOR: threads/lb: fix missing unlock on consistent hash LB
authorWilly Tarreau <w@1wt.eu>
Sun, 5 Nov 2017 09:54:50 +0000 (10:54 +0100)
committerWilly Tarreau <w@1wt.eu>
Sun, 5 Nov 2017 09:54:50 +0000 (10:54 +0100)
If no matching node was found, the function was left without unlocking
the tree.

src/lb_chash.c

index 32d7d1d1166f766da968e7c02fe03f99b3c42dc2..70a455dc3054dd2dd972eef44fc882c64305ce00 100644 (file)
@@ -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