diff --git a/src/acme.c b/src/acme.c index 44b0d7995..fe915d6ae 100644 --- a/src/acme.c +++ b/src/acme.c @@ -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; }