From: Alan T. DeKok Date: Mon, 2 Sep 2024 11:15:20 +0000 (-0400) Subject: just use function instead of "roll your own" code X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=98cd4bdaef75a5caa59d640b02956c2a1ecd1eb3;p=thirdparty%2Ffreeradius-server.git just use function instead of "roll your own" code which incidentally also handles unknown attributes, too --- diff --git a/src/lib/server/tmpl_tokenize.c b/src/lib/server/tmpl_tokenize.c index 39032f05ec..624004ef26 100644 --- a/src/lib/server/tmpl_tokenize.c +++ b/src/lib/server/tmpl_tokenize.c @@ -1237,7 +1237,6 @@ void tmpl_attr_set_list(tmpl_t *vpt, fr_dict_attr_t const *list) int tmpl_attr_afrom_list(TALLOC_CTX *ctx, tmpl_t **out, tmpl_t const *list, fr_dict_attr_t const *da) { tmpl_t *vpt; - tmpl_attr_t *ar; char attr[256]; ssize_t slen; @@ -1248,11 +1247,8 @@ int tmpl_attr_afrom_list(TALLOC_CTX *ctx, tmpl_t **out, tmpl_t const *list, fr_d * Copies request refs and the list ref */ tmpl_attr_copy(vpt, list); - tmpl_attr_set_list(vpt, tmpl_list(list)); /* Remove when lists are attributes */ - ar = tmpl_attr_add(vpt, TMPL_ATTR_TYPE_NORMAL); - ar->ar_da = da; - ar->ar_parent = fr_dict_root(fr_dict_by_da(da)); - tmpl_attr_set_leaf_num(vpt, tmpl_attr_tail_num(list)); + tmpl_attr_set_list(vpt, tmpl_list(list)); + tmpl_attr_set_leaf_da(vpt, da); /* * We need to rebuild the attribute name, to be the