BUG/MEDIUM: applet: Immediately free appctx on early error
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 16 Feb 2024 14:00:07 +0000 (15:00 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 16 Feb 2024 14:48:08 +0000 (15:48 +0100)
commitcd7e73efae643940153b891d3333b6042db14244
tree1b0e378e4512818e680f6a762d2b716e8fa1d24d
parent6a92fc704e14e7f2ea160856cece6cfa9ea63206
BUG/MEDIUM: applet: Immediately free appctx on early error

When an error is triggered during the applet initialization, a dedicated
function is called to release it. Indeed, in this case, because the applet
was not initialized, the ->release callback must not be called. However,
because the init stage may be delayed to be performed during the first
applet wakeup, we must also take care to not rely on the default
appctx_free() function, to immediately release the applet. Otherwise, if the
error happens in a delayed init stage, the applet is never released.

This patch partially fix the issue #2451. It must be backported as far as
2.6.
src/applet.c