]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: dict: race condition fix when inserting dictionary entries.
authorFrédéric Lécaille <flecaille@haproxy.com>
Tue, 11 Jun 2019 06:34:26 +0000 (08:34 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 11 Jun 2019 07:54:12 +0000 (09:54 +0200)
commitb5ecf0393cb8636bd838384f254a62f86839df17
treeae11ed51c4a2f6b6a9ed2132ccbefc836deb0c19
parente4d7c9dd65c197b6b948d98a4b9ea11c23f9bdd4
BUG/MINOR: dict: race condition fix when inserting dictionary entries.

When checking the result of an ebis_insert() call in an ebtree with unique keys,
if already present, in place of freeing() the old one and return the new one,
rather the correct way is to free the new one, and return the old one. For
this, the __dict_insert() function was folded into dict_insert() as this
significantly simplifies the test of duplicates.

Thanks to Olivier for having reported this bug which came with this one:
"MINOR: dict: Add dictionary new data structure".
src/dict.c