{
fr_value_box_t tmp;
fr_type_t src_type = FR_TYPE_STRING;
+ char *result;
RDEBUG4("EXPAND TMPL XLAT");
/* Error in expansion, this is distinct from zero length expansion */
- slen = xlat_aeval(tmp_ctx, (char **)&value.datum.ptr, request, vpt->name, escape, escape_ctx);
+ slen = xlat_aeval(tmp_ctx, &result, request, vpt->name, escape, escape_ctx);
if (slen < 0) goto error;
- value.vb_length = slen;
/*
* Undo any of the escaping that was done by the
* @fixme We need a way of signalling xlat not to escape things.
*/
ret = fr_value_box_from_str(tmp_ctx, &tmp, src_type, NULL,
- value.vb_strvalue, value.vb_length, '"', false);
+ result, (size_t)slen, '"', false);
if (ret < 0) goto error;
fr_value_box_bstrndup_shallow(&value, NULL, tmp.vb_strvalue, tmp.vb_length, tmp.tainted);
case TMPL_TYPE_REGEX_XLAT:
{
fr_value_box_t tmp;
- fr_type_t src_type = FR_TYPE_STRING;
+ fr_type_t src_type = FR_TYPE_STRING;
+ char *result;
RDEBUG4("EXPAND TMPL XLAT STRUCT");
RDEBUG2("EXPAND %s", vpt->name); /* xlat_struct doesn't do this */
/* Error in expansion, this is distinct from zero length expansion */
- slen = xlat_aeval_compiled(tmp_ctx, (char **)&value.datum.ptr, request, tmpl_xlat(vpt), escape, escape_ctx);
+ slen = xlat_aeval_compiled(tmp_ctx, &result, request, tmpl_xlat(vpt), escape, escape_ctx);
if (slen < 0) goto error;
- value.vb_length = slen;
-
/*
* Undo any of the escaping that was done by the
* xlat expansion function.
* @fixme We need a way of signalling xlat not to escape things.
*/
ret = fr_value_box_from_str(tmp_ctx, &tmp, src_type, NULL,
- value.vb_strvalue, value.vb_length, '"', false);
+ result, (size_t)slen, '"', false);
if (ret < 0) goto error;
fr_value_box_bstrndup_shallow(&value, NULL, tmp.vb_strvalue, tmp.vb_length, tmp.tainted);
* tmp_ctx is freed.
*/
if (value.datum.ptr && (talloc_parent(value.datum.ptr) == tmp_ctx)) {
- value.datum.ptr = talloc_reparent(tmp_ctx, ctx, value.datum.ptr);
+ (void)talloc_reparent(tmp_ctx, ctx, value.datum.ptr);
}
break;