BUG/MINOR: hlua: fix reference leak in core.register_task()

In core.register_task(): we take a reference to the function passed as
argument in order to push it in the new coroutine substack.
However, once pushed in the substack: the reference is not useful
anymore and should be cleared.
Currently, this is not the case in hlua_register_task().

Explicitly dropping the reference once the function is pushed to the
coroutine's stack to prevent any reference leak (which could contribute
to resource shortage)

This may be backported to every stable versions.
Please note that this commit depends on "MINOR: hlua: add simple hlua reference handling API"

(cherry picked from commit be58d6683c2d46732ea21eb55c4353a4e0c257a3)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit f6419c6ae85294d8adcbd80078d716bff5c76041)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 0c9befa5cffbed95ceace06292310c7ceb3810f7)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 5a2a2c2577036e6abb3eaf4f78aa41ed4087a486)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
1 file changed