]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
check fields only when they're valid
authorAlan T. DeKok <aland@freeradius.org>
Tue, 24 May 2022 18:21:07 +0000 (14:21 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 24 May 2022 20:46:49 +0000 (16:46 -0400)
src/lib/unlang/xlat_inst.c

index 3fff1b2c55ba82751dcc3dbccc0689b72118a3eb..816a2724f27664ce6b736749c38dff6c49d0eb1c 100644 (file)
@@ -260,8 +260,8 @@ static xlat_inst_t *xlat_inst_alloc(xlat_exp_t *node)
  */
 static int _xlat_instantiate_ephemeral_walker(xlat_exp_t *node, void *uctx)
 {
-       fr_event_list_t         *el = talloc_get_type_abort(uctx, fr_event_list_t);
-       xlat_call_t             *call = &node->call;
+       fr_event_list_t         *el;
+       xlat_call_t             *call;
        xlat_inst_t             *xi;
        xlat_thread_inst_t      *xt;
 
@@ -275,6 +275,9 @@ static int _xlat_instantiate_ephemeral_walker(xlat_exp_t *node, void *uctx)
 
        if (node->type != XLAT_FUNC) return 0; /* skip it */
 
+       el = talloc_get_type_abort(uctx, fr_event_list_t);
+       call = &node->call;
+
        fr_assert(!call->inst && !call->thread_inst);
 
        /*
@@ -322,6 +325,7 @@ static int _xlat_instantiate_ephemeral_walker(xlat_exp_t *node, void *uctx)
  * @note This must only be used for xlats created at runtime.
  *
  * @param[in] head of xlat tree to create instance data for.
+ * @param[in] el event list used to run any instantiate data
  */
 int xlat_instantiate_ephemeral(xlat_exp_head_t *head, fr_event_list_t *el)
 {