]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: lua: always detach the tcp/http tasks before freeing them
authorWilly Tarreau <w@1wt.eu>
Mon, 24 Jul 2017 15:35:27 +0000 (17:35 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 24 Jul 2017 15:35:27 +0000 (17:35 +0200)
In hlua_{http,tcp}_applet_release(), a call to task_free() is performed
to release the task, but no task_delete() is made on these tasks. Till
now it wasn't much of a problem because this was normally not done with
the task in the run queue, and the task was never put into the wait queue
since it doesn't have any timer. But with threading it will become an
issue. And not having this already prevents another bug from being fixed.

Thanks to Christopher for spotting this one. A backport to 1.7 and 1.6 is
preferred for safety.

src/hlua.c

index 35acff79cd352369bc36edb124ef7efb67f25f57..437f427bb84b693a1bb05c796f7b3d8559d41716 100644 (file)
@@ -6137,6 +6137,7 @@ error:
 
 static void hlua_applet_tcp_release(struct appctx *ctx)
 {
+       task_delete(ctx->ctx.hlua_apptcp.task);
        task_free(ctx->ctx.hlua_apptcp.task);
        ctx->ctx.hlua_apptcp.task = NULL;
        hlua_ctx_destroy(ctx->ctx.hlua_apptcp.hlua);
@@ -6423,6 +6424,7 @@ error:
 
 static void hlua_applet_http_release(struct appctx *ctx)
 {
+       task_delete(ctx->ctx.hlua_apphttp.task);
        task_free(ctx->ctx.hlua_apphttp.task);
        ctx->ctx.hlua_apphttp.task = NULL;
        hlua_ctx_destroy(ctx->ctx.hlua_apphttp.hlua);