From: Alan T. DeKok Date: Mon, 25 Sep 2023 00:23:31 +0000 (-0400) Subject: delete all matchine local variables X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=04fdc052f3f62aa93288ffbff59d2ad43d96fd41;p=thirdparty%2Ffreeradius-server.git delete all matchine local variables they can be created in any order, so we can't rely on just checking the tail --- diff --git a/src/lib/unlang/interpret.c b/src/lib/unlang/interpret.c index 1fa2101c8ec..4ceae8df2ae 100644 --- a/src/lib/unlang/interpret.c +++ b/src/lib/unlang/interpret.c @@ -217,9 +217,7 @@ typedef struct { static int _local_variables_free(unlang_variable_ref_t *ref) { - fr_pair_t *vp; - - while ((vp = fr_pair_list_tail(&ref->request->local_pairs)) != NULL) { + fr_pair_list_foreach(&ref->request->local_pairs, vp) { if (vp->da->dict != ref->dict) break; (void) fr_pair_delete(&ref->request->local_pairs, vp);