]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Annotate calls we know won't fail (CID #1503939) (#4722)
authorJames Jones <jejones3141@gmail.com>
Wed, 21 Sep 2022 13:53:39 +0000 (08:53 -0500)
committerGitHub <noreply@github.com>
Wed, 21 Sep 2022 13:53:39 +0000 (09:53 -0400)
The individual tests in edit_tests all operate on a three-element
pair list they get from add_pairs(), freeing it after they're done.
fr_pair_afrom_da() only returns NULL if it runs out of memory--
unlikely in this context, so we annotate the calls that add items
to the list.

src/lib/util/edit_tests.c

index ca116dc520a3f30cde6ebf2e45a783ec1bcfb56b..836071d30535a1f4000b935b859e41a68bd35c9e 100644 (file)
@@ -85,8 +85,11 @@ static void add_pairs(fr_pair_list_t *local_pairs)
 
        fr_pair_list_init(local_pairs);
 
+       /* coverity[dereference] */
        fr_pair_append(local_pairs, fr_pair_afrom_da(autofree, fr_dict_attr_test_uint32));
+       /* coverity[dereference] */
        fr_pair_append(local_pairs, fr_pair_afrom_da(autofree, fr_dict_attr_test_octets));
+       /* coverity[dereference] */
        fr_pair_append(local_pairs, fr_pair_afrom_da(autofree, fr_dict_attr_test_tlv));
 
        count = fr_pair_list_num_elements(local_pairs);