From: Christopher Faulet Date: Wed, 18 May 2022 05:42:49 +0000 (+0200) Subject: BUG/MINOR: spoe: Fix error handling in spoe_init_appctx() X-Git-Tag: v2.6-dev11~68 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fa463afa8f2fd5e4f5d72d3340a505edbd9fa069;p=thirdparty%2Fhaproxy.git 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. --- diff --git a/src/flt_spoe.c b/src/flt_spoe.c index 7d97fedd3a..bc21a9799e 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;