]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Handle using radius_pairmove to add a single pair to a list in rest.c
authorNick Porter <nick@portercomputing.co.uk>
Sat, 9 Jan 2021 14:07:02 +0000 (14:07 +0000)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 21 Jan 2021 23:05:49 +0000 (23:05 +0000)
src/modules/rlm_rest/rest.c

index 5359856989c0bb5bfa16e71d258a7b246c5ba5be..6d5c43c8097dec62975440bb7a6730c9b3e582f2 100644 (file)
@@ -1158,7 +1158,11 @@ static int json_pair_alloc(rlm_rest_t const *instance, rlm_rest_section_t const
                        RINDENT();
                        RDEBUG2("&%s:%pP", fr_table_str_by_value(pair_list_table, tmpl_list(dst), ""), vp);
                        REXDENT();
-                       radius_pairmove(current, vps, &vp, false);
+
+                       fr_pair_list_t tmp_list;
+                       fr_pair_list_init(&tmp_list);
+                       fr_pair_add(&tmp_list, vp);
+                       radius_pairmove(current, vps, &tmp_list, false);
                /*
                 *  If we call json_object_array_get_idx on something that's not an array
                 *  the behaviour appears to be to occasionally segfault.