From: Nick Porter Date: Tue, 8 Aug 2023 09:59:35 +0000 (+0100) Subject: Ensure temporary list is freed X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f6668b9fcba14a83b25d586a8917d8287bd82f97;p=thirdparty%2Ffreeradius-server.git Ensure temporary list is freed --- diff --git a/src/bin/unit_test_attribute.c b/src/bin/unit_test_attribute.c index 66cb49e4cfb..027d62bf23d 100644 --- a/src/bin/unit_test_attribute.c +++ b/src/bin/unit_test_attribute.c @@ -1185,6 +1185,7 @@ static size_t command_normalise_attribute(command_result_t *result, command_file fr_pair_list_init(&head); if (fr_pair_list_afrom_str(NULL, fr_dict_root(dict), in, inlen, &head) != T_EOL) { + fr_pair_list_free(&head); RETURN_OK_WITH_ERROR(); } @@ -1196,9 +1197,11 @@ static size_t command_normalise_attribute(command_result_t *result, command_file slen = fr_pair_list_print(&FR_SBUFF_OUT(data, COMMAND_OUTPUT_MAX), NULL, &head); if (slen <= 0) { fr_assert(0); + fr_pair_list_free(&head); RETURN_OK_WITH_ERROR(); } + fr_pair_list_free(&head); RETURN_OK(slen); }