From: James Jones Date: Mon, 12 Sep 2022 23:31:56 +0000 (-0500) Subject: move first use after NULL check (CID #1503920) (#4715) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cef35b2955faa142a8993399e42ce1f7b6ce523d;p=thirdparty%2Ffreeradius-server.git move first use after NULL check (CID #1503920) (#4715) --- diff --git a/src/lib/util/dict_util.c b/src/lib/util/dict_util.c index c5480c2e073..0c95fdf520e 100644 --- a/src/lib/util/dict_util.c +++ b/src/lib/util/dict_util.c @@ -1991,7 +1991,7 @@ fr_slen_t dict_by_protocol_substr(fr_dict_attr_err_t *err, { fr_dict_attr_t root; - fr_sbuff_t our_name = FR_SBUFF(name); + fr_sbuff_t our_name; fr_dict_t *dict; fr_slen_t slen; char buffer[FR_DICT_ATTR_MAX_NAME_LEN + 1 + 1]; /* +1 \0 +1 for "too long" */ @@ -2001,6 +2001,7 @@ fr_slen_t dict_by_protocol_substr(fr_dict_attr_err_t *err, FR_SBUFF_ERROR_RETURN(&our_name); } + our_name = FR_SBUFF(name); memset(&root, 0, sizeof(root)); /*