const VALUE_PAIR **pvp, uint8_t *ptr, size_t room);
/* valuepair.c */
-VALUE_PAIR *pairalloc(const DICT_ATTR *da);
+VALUE_PAIR *pairalloc(TALLOC_CTX *ctx, const DICT_ATTR *da);
VALUE_PAIR *paircreate(unsigned int attr, unsigned int vendor);
int pair2unknown(VALUE_PAIR *vp);
void pairfree(VALUE_PAIR **);
* And now that we've verified the basic type
* information, decode the actual data.
*/
- vp = pairalloc(da);
+ vp = pairalloc(NULL, da);
if (!vp) return -1;
vp->length = datalen;
*
* Allocates a new attribute and a new dictionary attr if no DA is provided.
*
+ * @param[in] ctx for allocated memory, usually a pointer to the request.
* @param[in] da Specifies the dictionary attribute to build the VP from.
* @return a new value pair or NULL if an error occurred.
*/
-VALUE_PAIR *pairalloc(const DICT_ATTR *da)
+VALUE_PAIR *pairalloc(UNUSED void *ctx, const DICT_ATTR *da)
{
VALUE_PAIR *vp;
}
}
- return pairalloc(da);
+ return pairalloc(NULL, da);
}
/** Free memory used by a single valuepair.
if (da->type != vp->da->type) return NULL;
- n = pairalloc(da);
+ n = pairalloc(NULL, da);
if (!n) {
return NULL;
}
* it. This next stop also looks the attribute up in the
* dictionary, and creates the appropriate type for it.
*/
- vp = pairalloc(da);
+ vp = pairalloc(NULL, da);
if (!vp) {
return NULL;
}
return pairmake_any(attrname, value, op);
}
- if ((vp = pairalloc(da)) == NULL) {
+ vp = pairalloc(NULL, da);
+ if (!vp) {
return NULL;
}
fr_int2str(fr_tokens, map->op, "¿unknown?"),
buffer);
- vp = pairalloc(map->dst->da);
+ vp = pairalloc(NULL, map->dst->da);
if (!vp) continue;
vp->op = map->op;
fr_int2str(fr_tokens, map->op, "¿unknown?"),
map->src->name);
- vp = pairalloc(map->dst->da);
+ vp = pairalloc(NULL, map->dst->da);
if (!vp) continue;
vp->op = map->op;
if (vp) pairfree(&vp);
da = dict_attrunknown(attr, vendor, TRUE);
if (!da) return NULL;
- vp = pairalloc(da);
+ vp = pairalloc(NULL, da);
if (size >= 253) size = 253;
vp->length = size;
memcpy(vp->vp_octets, data, vp->length);
* just use whatever was set in the attribute map.
*/
for (i = 0; i < self->count; i++) {
- vp = pairalloc(map->dst->da);
+ vp = pairalloc(NULL, map->dst->da);
rad_assert(vp);
pairparsevalue(vp, self->values[i]);
goto skip;
}
- vp = pairalloc(da);
+ vp = pairalloc(NULL, da);
if (!vp) {
radlog(L_ERR, "rlm_rest (%s): Failed creating"
" valuepair", instance->xlat_name);
return -1;
}
- vp = pairalloc(inst->sql_user);
+ vp = pairalloc(NULL, inst->sql_user);
vp->op = T_OP_SET;
strlcpy(vp->vp_strvalue, buffer, sizeof(vp->vp_strvalue));