From: Nick Porter Date: Thu, 11 Jan 2024 11:21:10 +0000 (+0000) Subject: Assign tmpl on heap for async expansion X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=80c63572b380294b0986b0db754e860e76866857;p=thirdparty%2Ffreeradius-server.git Assign tmpl on heap for async expansion --- diff --git a/src/modules/rlm_linelog/rlm_linelog.c b/src/modules/rlm_linelog/rlm_linelog.c index efa6585bc79..31b64f80d35 100644 --- a/src/modules/rlm_linelog/rlm_linelog.c +++ b/src/modules/rlm_linelog/rlm_linelog.c @@ -673,7 +673,7 @@ static unlang_action_t CC_HINT(nonnull) mod_do_linelog(rlm_rcode_t *p_result, mo char buff[4096]; char *p = buff; - tmpl_t empty, *vpt = NULL, *vpt_p = NULL; + tmpl_t *empty, *vpt = NULL, *vpt_p = NULL; ssize_t slen; bool with_delim; @@ -725,9 +725,10 @@ static unlang_action_t CC_HINT(nonnull) mod_do_linelog(rlm_rcode_t *p_result, mo tmpl_str = cf_pair_value(cp); if (!tmpl_str || (tmpl_str[0] == '\0')) { RDEBUG2("Path \"%s\" resolves to an empty config pair", p); - vpt_p = tmpl_init_shallow(&empty, TMPL_TYPE_DATA, T_DOUBLE_QUOTED_STRING, "", 0, NULL); - fr_value_box_init_null(&empty.data.literal); - fr_value_box_strdup_shallow(&empty.data.literal, NULL, "", false); + empty = talloc(frame_ctx, tmpl_t); + vpt_p = tmpl_init_shallow(empty, TMPL_TYPE_DATA, T_DOUBLE_QUOTED_STRING, "", 0, NULL); + fr_value_box_init_null(&empty->data.literal); + fr_value_box_strdup_shallow(&empty->data.literal, NULL, "", false); goto build_vector; }