From: Willy Tarreau Date: Wed, 17 Apr 2019 20:32:27 +0000 (+0200) Subject: CLEANUP: task: remain consistent when using the task's handler X-Git-Tag: v2.0-dev3~234 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=03dd029a5b84bb4de13c8c61af22555d294f64b2;p=thirdparty%2Fhaproxy.git CLEANUP: task: remain consistent when using the task's handler A pointer "process" is assigned the task's handler in process_runnable_tasks(), we have no reason to use t->process right after it is assigned. --- diff --git a/src/task.c b/src/task.c index abcb13baa0..52686cfb9d 100644 --- a/src/task.c +++ b/src/task.c @@ -384,13 +384,11 @@ void process_runnable_tasks() curr_task = (struct task *)t; if (likely(process == process_stream)) t = process_stream(t, ctx, state); + else if (process != NULL) + t = process(TASK_IS_TASKLET(t) ? NULL : t, ctx, state); else { - if (t->process != NULL) - t = process(TASK_IS_TASKLET(t) ? NULL : t, ctx, state); - else { - __task_free(t); - t = NULL; - } + __task_free(t); + t = NULL; } curr_task = NULL; /* If there is a pending state we have to wake up the task