From: Alan T. DeKok Date: Mon, 20 Jun 2022 21:30:57 +0000 (-0400) Subject: always initialize output X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=113761e0724bbb07e91c2bb91932c8a3650bfd1f;p=thirdparty%2Ffreeradius-server.git always initialize output --- diff --git a/src/lib/unlang/xlat_expr.c b/src/lib/unlang/xlat_expr.c index e2fc28c63f5..b6b57256d83 100644 --- a/src/lib/unlang/xlat_expr.c +++ b/src/lib/unlang/xlat_expr.c @@ -2506,7 +2506,7 @@ bool xlat_is_truthy(xlat_exp_head_t const *head, bool *out) /* * Only pure / constant things can be truthy. */ - if (!head->flags.pure) return false; + if (!head->flags.pure) goto return_false; node = xlat_exp_head(head); if (!node) { @@ -2514,7 +2514,7 @@ bool xlat_is_truthy(xlat_exp_head_t const *head, bool *out) return true; } - if (xlat_exp_next(head, node)) return false; + if (xlat_exp_next(head, node)) goto return_false; if (node->type == XLAT_BOX) { box = &node->data; @@ -2523,6 +2523,8 @@ bool xlat_is_truthy(xlat_exp_head_t const *head, bool *out) box = tmpl_value(node->vpt); } else { + return_false: + *out = false; return false; }