]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: config: fix multiple declaration of section parsers
authorWilly Tarreau <w@1wt.eu>
Thu, 26 May 2016 15:55:28 +0000 (17:55 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 26 May 2016 15:59:28 +0000 (17:59 +0200)
commit659fbf02300b721adef3de74a3c1a8e4d0851080
treedf83456b4bb2a08cdb21b22aec13feddcec8a9e5
parent5f6e9054b920b9952baa9860c6ead1039c66e940
BUG/MEDIUM: config: fix multiple declaration of section parsers

Ben Cabot reported that after commit 5e4261b ("CLEANUP: config:
detect double registration of a config section") recently introduced
in 1.7-dev, it's not possible anymore to load multiple configuration
files. Bryan Talbot provided a simple reproducer to exhibit the issue.

It turns out that function readcfgfile() registers new parsers for
section keywords for each new file. In addition to being useless, this
has the negative effect of wasting memory and slowing down the config
parser as the number of configuration files increases.

This fix only needs to be backported if/where the commit above is
backported.
src/cfgparse.c