From: Nick Porter Date: Wed, 28 Feb 2024 10:35:29 +0000 (+0000) Subject: If call_env custom parser returns nothing, skip the current pair X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=87df7da29a872267d4c7432d4b0fca66e7a9d8ac;p=thirdparty%2Ffreeradius-server.git If call_env custom parser returns nothing, skip the current pair --- diff --git a/src/lib/unlang/call_env.c b/src/lib/unlang/call_env.c index c93658e89e2..b9981a94985 100644 --- a/src/lib/unlang/call_env.c +++ b/src/lib/unlang/call_env.c @@ -470,6 +470,10 @@ static int call_env_parse(TALLOC_CTX *ctx, call_env_parsed_head_t *parsed, char talloc_free(tmp_cp); return -1; } + if (!call_env_parsed->data.ptr) { + talloc_free(call_env_parsed); + goto next_pair; + } } else { tmpl_t *parsed_tmpl; @@ -486,8 +490,9 @@ static int call_env_parse(TALLOC_CTX *ctx, call_env_parsed_head_t *parsed, char */ if (call_env_parsed_valid(call_env_parsed, cf_pair_to_item(to_parse), rule) < 0) goto error; - talloc_free(tmp_cp); call_env_parsed_insert_tail(parsed, call_env_parsed); + next_pair: + talloc_free(tmp_cp); cp = cf_pair_find_next(cs, cp, rule->name); } next: