]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: httpclient/lua: double LIST_DELETE on end of lua task
authorWilliam Lallemand <wlallemand@haproxy.org>
Thu, 8 Dec 2022 10:11:36 +0000 (11:11 +0100)
committerWilliam Lallemand <wlallemand@haproxy.org>
Thu, 8 Dec 2022 10:30:03 +0000 (11:30 +0100)
commit94dbfedec138101f314d746dab87caa3a1760b59
tree4e6422473e595a7981011e68aa06686e15226e2f
parent46676d44e04d4348d6d17317597692f674407038
BUG/MEDIUM: httpclient/lua: double LIST_DELETE on end of lua task

The lua httpclient cleanup can be called in 2 places, the
hlua_httpclient_gc() and the hlua_httpclient_destroy_all().

A LIST_DELETE() is performed to remove the hlua_hc struct of the list.
However, when the lua task ends and call hlua_ctx_destroy(), it does a
LIST_DELETE() first, and then the gc tries to do a LIST_DELETE() again
in hlua_httpclient_gc(), provoking a crash.

This patch fixes the issue by doing a LIST_DEL_INIT() instead of
LIST_DELETE() in both cases.

Should fix issue #1958.

Must be backported where bb58142 is backported.
src/hlua.c