From 848522f05df9e60eea9274e11f1e9fcd19594a5c Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Mon, 15 Oct 2018 11:12:15 +0200 Subject: [PATCH] BUILD: stick-table: make sure not to fail on task_new() during initialization Gcc reports a potential null-deref error in the stick-table init code. While not critical there, it's trivial to fix. This check has been missing since 1.4 so this fix can be backported to all supported versions. --- src/stick_table.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/stick_table.c b/src/stick_table.c index a65ceb056..d5d95ec96 100644 --- a/src/stick_table.c +++ b/src/stick_table.c @@ -603,6 +603,8 @@ int stktable_init(struct stktable *t) t->exp_next = TICK_ETERNITY; if ( t->expire ) { t->exp_task = task_new(MAX_THREADS_MASK); + if (!t->exp_task) + return 0; t->exp_task->process = process_table_expire; t->exp_task->context = (void *)t; }