]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Simplify csv_map_getvalue() to just append value to supplied list header
authorNick Porter <nick@portercomputing.co.uk>
Wed, 6 Jan 2021 14:58:32 +0000 (14:58 +0000)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 21 Jan 2021 23:05:49 +0000 (23:05 +0000)
src/modules/rlm_csv/rlm_csv.c

index bc1640a431a1ed65c3bc7e21204020c96423dd23..719db50c607dc916371e15299f177da02a56ff70 100644 (file)
@@ -844,14 +844,10 @@ static int mod_instantiate(void *instance, CONF_SECTION *conf)
 static int csv_map_getvalue(TALLOC_CTX *ctx, fr_pair_list_t *out, request_t *request, map_t const *map, void *uctx)
 {
        char const              *str = uctx;
-       fr_pair_list_t          head;
        fr_pair_t               *vp;
-       fr_cursor_t             cursor;
        fr_dict_attr_t          const *da;
 
        fr_assert(ctx != NULL);
-       fr_pair_list_init(&head);
-       fr_cursor_init(&cursor, &head);
 
        if (tmpl_is_attr(map->lhs)) {
                da = tmpl_da(map->lhs);
@@ -886,9 +882,8 @@ static int csv_map_getvalue(TALLOC_CTX *ctx, fr_pair_list_t *out, request_t *req
        }
 
        vp->op = map->op;
-       fr_cursor_append(&cursor, vp);
+       fr_pair_add(out, vp);
 
-       *out = head;
        return 0;
 }