]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Initialise temporary event list if we're not passed one in unlang_interpret_synchronous
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 8 Sep 2021 23:42:57 +0000 (18:42 -0500)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 8 Sep 2021 23:42:57 +0000 (18:42 -0500)
src/lib/server/trigger.c
src/lib/unlang/interpret_synchronous.c

index 68293fa0100166143d0f6dfd126cdab82138e051..39b3a461c5c1098d601763db2fc4dab144203e84 100644 (file)
@@ -463,7 +463,7 @@ int trigger_exec(unlang_interpret_t *intp, request_t *request,
                 *      with something like the server
                 *      shutting down.
                 */
-               unlang_interpret_synchronous(unlang_interpret_event_list(request), child);
+               unlang_interpret_synchronous(NULL, child);
                talloc_free(child);
        }
 
index 8cc6e7db3bf24e545054db7b00b3cc56ee572f1b..1f3ec1970d84813ea5fd87973ac3ab240f354049 100644 (file)
@@ -196,9 +196,13 @@ rlm_rcode_t unlang_interpret_synchronous(fr_event_list_t *el, request_t *request
        bool                            dont_wait_for_event;
        int                             iterations = 0;
 
+       fr_event_list_t                 *our_el = NULL;
+
        old_intp = unlang_interpret_get(request);
        caller = request->module;
 
+       if (!el) el = our_el = fr_event_list_alloc(NULL, NULL, NULL);
+
        intps = unlang_interpret_synchronous_alloc(request, el);
        unlang_interpret_set(request, intps->intp);
 
@@ -278,6 +282,8 @@ rlm_rcode_t unlang_interpret_synchronous(fr_event_list_t *el, request_t *request
                DEBUG3("%u runnable, %u yielded", fr_heap_num_elements(intps->runnable), intps->yielded);
        }
 
+       if (our_el) talloc_free(our_el);
+
        talloc_free(intps);
        unlang_interpret_set(request, old_intp);
        request->module = caller;