]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
thread_instantiate may be NULL
authorAlan T. DeKok <aland@freeradius.org>
Mon, 14 Nov 2022 21:39:51 +0000 (16:39 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 14 Nov 2022 21:48:08 +0000 (16:48 -0500)
but we may still have thread instance data, which is just
counters

src/lib/unlang/compile.c

index 246d29a88a7bcf92f8fd751086bf9883b7c39c24..134d1256c6aecc700527f347bacba1d16d6c470a 100644 (file)
@@ -4569,7 +4569,6 @@ int unlang_thread_instantiate(TALLOC_CTX *ctx)
                unlang_thread_array[instruction->number].instruction = instruction;
 
                op = &unlang_ops[instruction->type];
-               if (!op->thread_instantiate) continue;
 
                /*
                 *      Allocate any thread-specific instance data.
@@ -4579,7 +4578,7 @@ int unlang_thread_instantiate(TALLOC_CTX *ctx)
                        talloc_set_name_const(unlang_thread_array[instruction->number].thread_inst, op->thread_inst_type);
                }
 
-               if (op->thread_instantiate(instruction, unlang_thread_array[instruction->number].thread_inst) < 0) {
+               if (op->thread_instantiate && (op->thread_instantiate(instruction, unlang_thread_array[instruction->number].thread_inst) < 0)) {
                        return -1;
                }
        }