From: Alan T. DeKok Date: Sat, 22 Nov 2025 14:17:26 +0000 (-0500) Subject: don't check for encode_pair in union encoder X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e9b0ea81058bdf31be13f5c1fa1566030abb908c;p=thirdparty%2Ffreeradius-server.git don't check for encode_pair in union encoder the encode_pair function is needed only by encode_tlv, which already checks for the existence of encode_pair --- diff --git a/src/lib/util/struct.c b/src/lib/util/struct.c index e5953ba9d39..1d4a5d8e89d 100644 --- a/src/lib/util/struct.c +++ b/src/lib/util/struct.c @@ -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;