]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: cfgparse: Fix the call to post parser of the last sections parsed
authorChristopher Faulet <cfaulet@haproxy.com>
Sun, 2 Dec 2018 08:37:38 +0000 (09:37 +0100)
committerWilly Tarreau <w@1wt.eu>
Sun, 2 Dec 2018 09:21:47 +0000 (10:21 +0100)
Wrong variable was used to know if we need to call the callback
post_section_parser() or not. We must use 'cs' and not 'pcs'.

This patch must be backported in 1.8 with the commit 7805e2b ("BUG/MINOR:
cfgparse: Fix transition between 2 sections with the same name").

src/cfgparse.c

index a28d24cce9ddd9f1f096c16e57efc64ac9ab5d4b..d754dd55e06584fd7861f572c8404d6b6ecc5a56 100644 (file)
@@ -1890,8 +1890,8 @@ next_line:
                        err_code |= pcs->post_section_parser();
                        if (err_code & ERR_ABORT)
                                goto err;
-                       pcs = NULL;
                }
+               pcs = NULL;
 
                if (!cs) {
                        ha_alert("parsing [%s:%d]: unknown keyword '%s' out of section.\n", file, linenum, args[0]);
@@ -1903,7 +1903,7 @@ next_line:
                }
        }
 
-       if (cs && pcs->post_section_parser)
+       if (cs && cs->post_section_parser)
                err_code |= cs->post_section_parser();
 
 err: