while (attr < end) {
slen = fr_radius_decode_pair(ctx, out, attr, (end - attr), &decode_ctx);
if (slen < 0) {
+ fail:
talloc_free(decode_ctx.tmp_ctx);
- return slen - (attr - data);
+ talloc_free(decode_ctx.tags);
+ return slen;
}
/*
* all kinds of bad things happen.
*/
if (!fr_cond_assert(slen <= (end - attr))) {
- talloc_free(decode_ctx.tmp_ctx);
- return -slen - (attr - data);
+ goto fail;
}
attr += slen;
}
talloc_free(decode_ctx.tmp_ctx);
+ talloc_free(decode_ctx.tags);
return data_len;
}