}
MEM(vb = fr_value_box_alloc(ctx, FR_TYPE_STRING, NULL));
- fr_value_box_bstrndup(ctx, vb, NULL, type, strlen(type), false);
+ fr_value_box_bstrndup(vb, vb, NULL, type, strlen(type), false);
fr_dcursor_append(out, vb);
return XLAT_ACTION_DONE;
}
MEM(vb = fr_value_box_alloc(ctx, FR_TYPE_STRING, NULL));
- fr_value_box_bstrndup(ctx, vb, NULL, encrypted, strlen(encrypted), false);
+ fr_value_box_bstrndup(vb, vb, NULL, encrypted, strlen(encrypted), false);
fr_dcursor_append(out, vb);
return XLAT_ACTION_DONE;
/*
* Just copy the string to the box.
*/
- fr_value_box_bstrndup(ctx, out, NULL, value, len, tainted);
+ fr_value_box_bstrndup(out, out, NULL, value, len, tainted);
}
break;
{
char const *value = json_object_to_json_string(object);
- fr_value_box_bstrndup(ctx, out, NULL, value, strlen(value), tainted);
+ fr_value_box_bstrndup(out, out, NULL, value, strlen(value), tainted);
}
break;
}
*/
size_t fr_ldap_escape_func(UNUSED request_t *request, char *out, size_t outlen, char const *in, UNUSED void *arg)
{
-
size_t left = outlen;
if (*in && ((*in == ' ') || (*in == '#'))) goto encode;
if (shallow) {
fr_value_box_bstrndup_shallow(to_cast, NULL, reply->str, reply->len, true);
} else {
- if (fr_value_box_bstrndup(ctx, to_cast, NULL, reply->str, reply->len, true) < 0) return -1;
+ if (fr_value_box_bstrndup(to_cast, to_cast, NULL, reply->str, reply->len, true) < 0) return -1;
}
break;
fr_strerror_const("Out of memory");
return -1;
}
- if (fr_value_box_bstrndup(ctx, verb, NULL, reply->str, reply->len, true) < 0) return -1;
+ if (fr_value_box_bstrndup(verb, verb, NULL, reply->str, reply->len, true) < 0) return -1;
fr_value_box_list_insert_head(&out->vb_group, verb);
vtype = fr_value_box_alloc(ctx, FR_TYPE_STRING, NULL);
if (!value) return XLAT_ACTION_DONE;
MEM(vb = fr_value_box_alloc_null(ctx));
- fr_value_box_bstrndup(ctx, vb, NULL, value, strlen(value), false);
+ fr_value_box_bstrndup(vb, vb, NULL, value, strlen(value), false);
fr_dcursor_append(out, vb);
return XLAT_ACTION_DONE;
MEM(*vb_out = fr_value_box_alloc_null(ctx));
- ret = needs_dup ? fr_value_box_copy(ctx, *vb_out, to_cast) : fr_value_box_steal(ctx, *vb_out, to_cast);
+ ret = needs_dup ? fr_value_box_copy(*vb_out, *vb_out, to_cast) : fr_value_box_steal(*vb_out, *vb_out, to_cast);
talloc_free(tmp_ctx);
if (ret < 0) {
RPEDEBUG("Failed copying data to output box");
}
MEM(vb = fr_value_box_alloc_null(ctx));
- fr_value_box_copy(ctx, vb, &vp->data);
+ fr_value_box_copy(vb, vb, &vp->data);
fr_dcursor_append(out, vb);
return XLAT_ACTION_DONE;
}
data:
MEM(box = fr_value_box_alloc_null(state));
- if (fr_value_box_copy(state, box, tmpl_value(vpt)) < 0) return -1;
+ if (fr_value_box_copy(box, box, tmpl_value(vpt)) < 0) return -1;
fr_value_box_list_insert_tail(¤t->parent->rhs.result, box);
vp = tmpl_dcursor_init(NULL, request, &cc, &cursor, request, vpt);
while (vp) {
MEM(box = fr_value_box_alloc_null(state));
- if (fr_value_box_copy(state, box, &vp->data) < 0) return -1;
+ if (fr_value_box_copy(box, box, &vp->data) < 0) return -1;
fr_value_box_list_insert_tail(¤t->parent->rhs.result, box);
fr_assert(vp != NULL);
MEM(vb = fr_value_box_alloc_null(ctx));
- fr_value_box_copy(ctx, vb, &vp->data);
+ fr_value_box_copy(vb, vb, &vp->data);
fr_dcursor_append(out, vb);
return XLAT_ACTION_DONE;
}
if (fr_sbuff_behind(&m_start) == 0) goto advance;
MEM(vb = fr_value_box_alloc_null(ctx));
- fr_value_box_bstrndup(ctx, vb, NULL, fr_sbuff_current(&m_start),
+ fr_value_box_bstrndup(vb, vb, NULL, fr_sbuff_current(&m_start),
fr_sbuff_behind(&m_start), string->tainted);
fr_dcursor_append(out, vb);
}
fr_sbuff_set_to_end(&sbuff);
MEM(vb = fr_value_box_alloc_null(ctx));
- fr_value_box_bstrndup(ctx, vb, NULL, fr_sbuff_current(&m_start),
+ fr_value_box_bstrndup(vb, vb, NULL, fr_sbuff_current(&m_start),
fr_sbuff_behind(&m_start), string->tainted);
fr_dcursor_append(out, vb);
break;
fr_snprint_uint128(buff, sizeof(buff), ntohlll(ipv6int));
MEM(vb = fr_value_box_alloc_null(ctx));
- fr_value_box_bstrndup(ctx, vb, NULL, buff, strlen(buff), false);
+ fr_value_box_bstrndup(vb, vb, NULL, buff, strlen(buff), false);
fr_dcursor_append(out, vb);
talloc_free(in_vb);
return XLAT_ACTION_DONE;
* because references aren't threadsafe.
*/
MEM(value = fr_value_box_alloc_null(ctx));
- if (fr_value_box_copy(ctx, value, &node->data) < 0) goto fail;
+ if (fr_value_box_copy(value, value, &node->data) < 0) goto fail;
fr_dcursor_append(out, value);
continue;
(tmpl_list(map->lhs) != tmpl_list(target))) continue;
MEM(vb = fr_value_box_alloc_null(ctx));
- fr_value_box_copy(ctx, vb, tmpl_value(map->rhs));
+ fr_value_box_copy(vb, vb, tmpl_value(map->rhs));
fr_dcursor_append(out, vb);
break;
}
MEM(vb = fr_value_box_alloc_null(ctx));
- if (fr_value_box_bstrndup(ctx, vb, NULL, da->name, strlen(da->name), false) < 0) {
+ if (fr_value_box_bstrndup(vb, vb, NULL, da->name, strlen(da->name), false) < 0) {
talloc_free(vb);
return XLAT_ACTION_FAIL;
}
MEM(vb = fr_value_box_alloc_null(ctx));
- if (fr_value_box_bstrndup(ctx, vb, NULL, da->name, strlen(da->name), false) < 0) {
+ if (fr_value_box_bstrndup(vb, vb, NULL, da->name, strlen(da->name), false) < 0) {
talloc_free(vb);
return XLAT_ACTION_FAIL;
}
MEM(vb = fr_value_box_alloc_null(ctx));
- if (fr_value_box_bstrndup(ctx, vb, NULL, vendor->name, strlen(vendor->name), false) < 0) {
+ if (fr_value_box_bstrndup(vb, vb, NULL, vendor->name, strlen(vendor->name), false) < 0) {
talloc_free(vb);
return XLAT_ACTION_FAIL;
}
MEM(vb = fr_value_box_alloc_null(ctx));
- if (fr_value_box_bstrndup(ctx, vb, NULL, vp->da->name, strlen(vp->da->name), false) < 0) {
+ if (fr_value_box_bstrndup(vb, vb, NULL, vp->da->name, strlen(vp->da->name), false) < 0) {
talloc_free(vb);
return XLAT_ACTION_FAIL;
}
count = ldap_count_values_len(values);
for (i = 0; i < count; i++) {
MEM(vb = fr_value_box_alloc_null(ctx));
- if (fr_value_box_bstrndup(ctx, vb, NULL, values[i]->bv_val, values[i]->bv_len, true) < 0) {
+ if (fr_value_box_bstrndup(vb, vb, NULL, values[i]->bv_val, values[i]->bv_len, true) < 0) {
talloc_free(vb);
RPERROR("Failed creating value from LDAP response");
break;
DEBUG3("String returned");
tmp = SvPVutf8(sv, len);
MEM(vb = fr_value_box_alloc_null(ctx));
- if (fr_value_box_bstrndup(ctx, vb, NULL, tmp, len, SvTAINTED(sv)) < 0) {
+ if (fr_value_box_bstrndup(vb, vb, NULL, tmp, len, SvTAINTED(sv)) < 0) {
talloc_free(vb);
RPEDEBUG("Failed to allocate %ld for output", len);
return -1;
* Add key first
*/
MEM(vb = fr_value_box_alloc_null(ctx));
- if (fr_value_box_bstrndup(ctx, vb, NULL, tmp, sv_len, SvTAINTED(hv_sv)) < 0) {
+ if (fr_value_box_bstrndup(vb, vb, NULL, tmp, sv_len, SvTAINTED(hv_sv)) < 0) {
talloc_free(vb);
RPEDEBUG("Failed to allocate %d for output", sv_len);
return -1;
fr_value_box_list_foreach(in, vb_p) {
MEM(vb = fr_value_box_alloc(ctx, FR_TYPE_STRING, NULL));
- if (fr_value_box_copy(ctx, vb, vb_p) < 0) {
+ if (fr_value_box_copy(vb, vb, vb_p) < 0) {
talloc_free(vb);
return XLAT_ACTION_FAIL;
}