]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
use merge to merge lists of cursors
authorAlan T. DeKok <aland@freeradius.org>
Mon, 2 Nov 2020 14:10:17 +0000 (09:10 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 2 Nov 2020 14:10:17 +0000 (09:10 -0500)
src/lib/util/pair_legacy.c

index c1960bf89d9f8866188de0ea531ee331b7410617..04e138d71a7ec84cd33b07fd3a859583697ee159 100644 (file)
@@ -611,6 +611,8 @@ int fr_pair_list_afrom_file(TALLOC_CTX *ctx, fr_dict_t const *dict, fr_pair_t **
        fr_cursor_init(&cursor, out);
 
        while (fgets(buf, sizeof(buf), fp) != NULL) {
+               fr_cursor_t append;
+
                /*
                 *      If we get a '\n' by itself, we assume that's
                 *      the end of that VP list.
@@ -638,7 +640,8 @@ int fr_pair_list_afrom_file(TALLOC_CTX *ctx, fr_dict_t const *dict, fr_pair_t **
                        break;
                }
 
-               fr_cursor_append(&cursor, vp);
+               fr_cursor_init(&append, &vp);
+               fr_cursor_merge(&cursor, &append);
                (void) fr_cursor_tail(&cursor);
 
                buf[0] = '\0';