From: Willy Tarreau Date: Mon, 15 Oct 2018 09:12:15 +0000 (+0200) Subject: BUILD: stick-table: make sure not to fail on task_new() during initialization X-Git-Tag: v1.9-dev4~42 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=848522f05df9e60eea9274e11f1e9fcd19594a5c;p=thirdparty%2Fhaproxy.git 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. --- diff --git a/src/stick_table.c b/src/stick_table.c index a65ceb056e..d5d95ec96a 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; }