From fa463afa8f2fd5e4f5d72d3340a505edbd9fa069 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Wed, 18 May 2022 07:42:49 +0200 Subject: [PATCH] BUG/MINOR: spoe: Fix error handling in spoe_init_appctx() labels used in goto statement was not called in the right order. Thus if there is an error during the appctx startup, it is possible to leak a task. This patch should fix the issue #1703. No backport needed. --- src/flt_spoe.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/flt_spoe.c b/src/flt_spoe.c index 7d97fedd3..bc21a9799 100644 --- a/src/flt_spoe.c +++ b/src/flt_spoe.c @@ -1223,12 +1223,12 @@ spoe_init_appctx(struct appctx *appctx) struct stream *s; if ((task = task_new_here()) == NULL) - goto out_free_task; + goto out_error; task->process = spoe_process_appctx; task->context = appctx; if (appctx_finalize_startup(appctx, &agent->spoe_conf->agent_fe, &BUF_NULL) == -1) - goto out_error; + goto out_free_task; spoe_appctx->owner = appctx; spoe_appctx->task = task;