mirror of
https://github.com/haproxy/haproxy.git
synced 2026-06-08 16:23:24 -04:00
BUG/MINOR: acme: fix task allocation leaked upon error
Fix a leak of the task object in acme_start_task() when one of the condition in the function failed. Fix issue #3308. Must be backported to 3.2 and later.
This commit is contained in:
parent
506cfcb5d4
commit
d26bd9f978
1 changed files with 3 additions and 1 deletions
|
|
@ -2667,7 +2667,7 @@ EVP_PKEY *acme_gen_tmp_pkey()
|
|||
/* start an ACME task */
|
||||
static int acme_start_task(struct ckch_store *store, char **errmsg)
|
||||
{
|
||||
struct task *task;
|
||||
struct task *task = NULL;
|
||||
struct acme_ctx *ctx = NULL;
|
||||
struct acme_cfg *cfg;
|
||||
struct ckch_store *newstore = NULL;
|
||||
|
|
@ -2752,6 +2752,8 @@ err:
|
|||
HA_RWLOCK_WRUNLOCK(OTHER_LOCK, &acme_lock);
|
||||
acme_ctx_destroy(ctx);
|
||||
}
|
||||
if (task)
|
||||
task_destroy(task);
|
||||
memprintf(errmsg, "%sCan't start the ACME client.", *errmsg ? *errmsg : "");
|
||||
return 1;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue