From: Arran Cudbard-Bell Date: Wed, 3 Nov 2021 21:00:05 +0000 (-0400) Subject: Fix case in tmpl_extents_find for where the leaf attribute exists X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=def5219a74242f13d714dc0760c90386ab52ca37;p=thirdparty%2Ffreeradius-server.git Fix case in tmpl_extents_find for where the leaf attribute exists We still want to return its direct parent as a leaf --- diff --git a/src/lib/server/tmpl_eval.c b/src/lib/server/tmpl_eval.c index 20e9addafa6..0c5a63ff7c2 100644 --- a/src/lib/server/tmpl_eval.c +++ b/src/lib/server/tmpl_eval.c @@ -1387,7 +1387,6 @@ int tmpl_find_or_add_vp(fr_pair_t **out, request_t *request, tmpl_t const *vpt) * @param[in] vpt specifying the #fr_pair_t type to retrieve or create. * Must be #TMPL_TYPE_ATTR. * @return - * - 1 on success a pair was created. * - 0 on success a pair was found. * - -1 if a new #fr_pair_t couldn't be found or created. * - -2 if list could not be found (doesn't exist in current #request_t). @@ -1539,6 +1538,7 @@ int tmpl_extents_find(TALLOC_CTX *ctx, continue; default: + if (leaf) EXTENT_ADD(leaf, NULL, list_ctx, list_head); break; } }