From: Alan T. DeKok Date: Fri, 27 Oct 2023 00:42:10 +0000 (-0400) Subject: cleanups and checks for static analysis X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=734209e58a13a29b17ca22151cedd8e6e3ebd08e;p=thirdparty%2Ffreeradius-server.git cleanups and checks for static analysis --- diff --git a/src/lib/util/pair_legacy.c b/src/lib/util/pair_legacy.c index 694b17f4765..a70737e0422 100644 --- a/src/lib/util/pair_legacy.c +++ b/src/lib/util/pair_legacy.c @@ -129,6 +129,8 @@ fr_slen_t fr_pair_list_afrom_substr(fr_pair_parse_t const *root, fr_pair_parse_t fr_sbuff_marker_t lhs_m, rhs_m; fr_sbuff_t our_in = FR_SBUFF(in); + if (!root->ctx || !root->da || !root->list) return 0; + redo: fr_sbuff_adv_past_whitespace(&our_in, SIZE_MAX, NULL); @@ -364,9 +366,7 @@ parse_rhs: * The RHS is a list, go parse the nested attributes. */ if (fr_sbuff_next_if_char(&our_in, '{')) { - fr_pair_parse_t child = (fr_pair_parse_t) { - .depth = relative->depth + 1, - }; + fr_pair_parse_t child = (fr_pair_parse_t) { }; if (!fr_type_is_structural(vp->vp_type)) { fr_strerror_const("Cannot assign list to leaf data type"); diff --git a/src/lib/util/pair_legacy.h b/src/lib/util/pair_legacy.h index a3965055333..f5b46955dbc 100644 --- a/src/lib/util/pair_legacy.h +++ b/src/lib/util/pair_legacy.h @@ -45,7 +45,6 @@ typedef struct { TALLOC_CTX *ctx; fr_dict_attr_t const *da; fr_pair_list_t *list; - int depth; } fr_pair_parse_t; fr_slen_t fr_pair_list_afrom_substr(fr_pair_parse_t const *root, fr_pair_parse_t *relative,