/*
* Like tmpl_preparse(), but expands variables.
*/
-static ssize_t cond_preparse(char const **out, size_t *outlen, char const *start,
+static ssize_t cond_preparse(TALLOC_CTX *ctx, char const **out, size_t *outlen, char const *start,
FR_TOKEN *type, char const **error,
fr_dict_attr_t const **castda, bool require_regex,
CONF_SECTION *parent, char const *filename, int lineno)
/*
* cf_expand_variables() doesn't take a length. Oh well...
*/
- expanded = talloc_strndup(parent, start, slen);
+ expanded = talloc_strndup(ctx, start, slen);
if (!expanded) {
oom:
*error = "Failed allocating memory";
* 'out' now points to 'buffer', which we don't want. So
* we need to return a string which the caller can keep track of.
*/
- expanded = talloc_strndup(parent, *out, *outlen);
+ expanded = talloc_strndup(ctx, *out, *outlen);
if (!expanded) goto oom;
*out = expanded;
/*
* Grab the LHS
*/
- slen = cond_preparse(&lhs, &lhs_len, p, &lhs_type, error, &c->cast, false, parent, filename, lineno);
+ slen = cond_preparse(c, &lhs, &lhs_len, p, &lhs_type, error, &c->cast, false, parent, filename, lineno);
if (slen <= 0) {
return_SLEN;
}
return_P("Expected text after operator");
}
- slen = cond_preparse(&rhs, &rhs_len, p, &rhs_type, error, NULL, regex, parent, filename, lineno);
+ slen = cond_preparse(c, &rhs, &rhs_len, p, &rhs_type, error, NULL, regex, parent, filename, lineno);
if (slen <= 0) {
return_SLEN;
}