BUG/MINOR: lua: Duplicate map name to load it when a new Map object is created
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 6 Aug 2020 06:40:09 +0000 (08:40 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 11 Aug 2020 09:37:02 +0000 (11:37 +0200)
commitab70b9ef3362f276b63a14289741e20f4826613a
tree351f0e2fe9ed542ff6804fe50e694fa95f8aee9c
parente9768f22d19276332ec16db585af6d1de0503931
BUG/MINOR: lua: Duplicate map name to load it when a new Map object is created

When a new map is created, the sample_load_map() function is called. To do so,
an argument array is created with the name as first argument. Because it is a
lua string, owned by the lua, it must be duplicated. The sample_load_map()
function will convert this argument to a map. In theory, after the conversion,
it must release the original string. It is not performed for now and it is a bug
that will be fixed in the next commit.

This patch may be backported to all supported versions, most probably as far as
2.1 only. But it must be backported with the next commit "BUG/MINOR: arg: Fix
leaks during arguments validation for fetches/converters".

(cherry picked from commit 73292e9e660b98467ed48266d25684fa1e0bcebd)
Signed-off-by: Willy Tarreau <w@1wt.eu>
(cherry picked from commit 2c8b3c9893bbff3afc9c29dbee2cb2b52e3f63ff)
Signed-off-by: Willy Tarreau <w@1wt.eu>
src/hlua.c