From: Nick Porter Date: Thu, 2 Nov 2023 11:17:54 +0000 (+0000) Subject: Use taloc_typed_strdup when xlat_eval returns no values X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=043dd3bd7cd4ee7f35de61d82e1b2871264cbc1f;p=thirdparty%2Ffreeradius-server.git Use taloc_typed_strdup when xlat_eval returns no values Otherwise using the resulting string in fr_pair_value_bstrdup_buffer_shallow() or other functions which check the talloc type will fail. --- diff --git a/src/lib/unlang/xlat_eval.c b/src/lib/unlang/xlat_eval.c index 77d4805a4b5..453c6d970f3 100644 --- a/src/lib/unlang/xlat_eval.c +++ b/src/lib/unlang/xlat_eval.c @@ -1397,7 +1397,7 @@ static ssize_t xlat_eval_sync(TALLOC_CTX *ctx, char **out, request_t *request, x goto error; } } else { - str = talloc_strdup(ctx, ""); + str = talloc_typed_strdup(ctx, ""); } talloc_free(pool); /* Memory should be in new ctx */