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.

(cherry picked from commit cd7e73efae643940153b891d3333b6042db14244)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit d464b9c5fb0cece499b2025e20b418b1235007b2)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
1 file changed