]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: map: correctly track reference to the last ref_elt being dumped
authorDragan Dosen <ddosen@haproxy.com>
Fri, 4 May 2018 14:27:15 +0000 (16:27 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 4 May 2018 15:14:39 +0000 (17:14 +0200)
The bug was introduced in the commit 8d85aa4 ("BUG/MAJOR: map: fix
segfault during 'show map/acl' on cli").

This patch should be backported to 1.8, 1.7 and 1.6.

src/map.c

index ad47c7f233fa570d9ca24fba8a2efb93b92ed720..0f1b75476024bbbc15e3ab1dd757f7afd7bfde81 100644 (file)
--- a/src/map.c
+++ b/src/map.c
@@ -307,9 +307,9 @@ static int cli_io_handler_pat_list(struct appctx *appctx)
                 * reference to the last ref_elt being dumped.
                 */
                if (appctx->st2 == STAT_ST_LIST) {
-                       if (!LIST_ISEMPTY(&appctx->ctx.sess.bref.users)) {
-                               LIST_DEL(&appctx->ctx.sess.bref.users);
-                               LIST_INIT(&appctx->ctx.sess.bref.users);
+                       if (!LIST_ISEMPTY(&appctx->ctx.map.bref.users)) {
+                               LIST_DEL(&appctx->ctx.map.bref.users);
+                               LIST_INIT(&appctx->ctx.map.bref.users);
                        }
                }
                return 1;