]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: stick-table: make sure not to fail on task_new() during initialization
authorWilly Tarreau <w@1wt.eu>
Mon, 15 Oct 2018 09:12:15 +0000 (11:12 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 15 Oct 2018 11:24:43 +0000 (13:24 +0200)
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

index a65ceb056e3b5518511f8e5950049d3f2f28cf58..d5d95ec96ac0d1d79a814ebaba9bf25497c668fc 100644 (file)
@@ -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;
                }