]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
manually free the pair list, as done in the other test functions.
authorAlan T. DeKok <aland@freeradius.org>
Tue, 5 Apr 2022 22:22:27 +0000 (18:22 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 7 Apr 2022 15:23:35 +0000 (11:23 -0400)
otherwise with the new tlist code, the pairs are freed via
the talloc_free_children() callback, and the PAIR_VERIFY() check
fails, because the pair is still in a list.

src/bin/unit_test_attribute.c

index 125bac9d8cf2675060a57695b5dd8196c26ea00a..fb9686b18622df565fbd4902b301cd6b617f577f 100644 (file)
@@ -2343,6 +2343,8 @@ static size_t command_pair(command_result_t *result, command_file_ctx_t *cc,
                }
        }
 
+       PAIR_LIST_VERIFY(&head);
+
        p = data;
        end = data + COMMAND_OUTPUT_MAX;
        for (vp = fr_pair_list_head(&head);
@@ -2363,6 +2365,8 @@ static size_t command_pair(command_result_t *result, command_file_ctx_t *cc,
        if (p > data) p -= 2;
        *p = 0;
 
+       fr_pair_list_free(&head);
+
        RETURN_OK(p - data);
 }