]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
don't check for encode_pair in union encoder
authorAlan T. DeKok <aland@freeradius.org>
Sat, 22 Nov 2025 14:17:26 +0000 (09:17 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Sat, 22 Nov 2025 14:17:26 +0000 (09:17 -0500)
the encode_pair function is needed only by encode_tlv, which already
checks for the existence of encode_pair

src/lib/util/struct.c

index e5953ba9d3916fef69eb4ba5ba2d5e1a4655226e..1d4a5d8e89d40718238c68b57a20dcf2701a0a6b 100644 (file)
@@ -584,12 +584,6 @@ static ssize_t encode_union(fr_dbuff_t *dbuff, fr_dict_attr_t const *wrapper,
        fr_dcursor_t    child_cursor;
        fr_dbuff_t      work_dbuff = FR_DBUFF(dbuff);
 
-       if (!encode_pair) {
-               fr_strerror_printf("Asked to encode child attribute %s, but we were not passed an encoding function",
-                                  wrapper->name);
-               return PAIR_ENCODE_FATAL_ERROR;
-       }
-
        parent = fr_dcursor_current(cursor);
        if (!parent || (parent->da != wrapper)) return 0;