From: Nick Porter Date: Tue, 22 Dec 2020 17:43:14 +0000 (+0000) Subject: Use correct free routine for individual vps X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8cfc8fcce996ac62863f4adf8cc30d90e75ffe19;p=thirdparty%2Ffreeradius-server.git Use correct free routine for individual vps --- diff --git a/src/lib/server/map.c b/src/lib/server/map.c index f12f4fe3378..3fe73924333 100644 --- a/src/lib/server/map.c +++ b/src/lib/server/map.c @@ -936,7 +936,7 @@ static int map_exec_to_vp(TALLOC_CTX *ctx, fr_pair_list_t *out, request_t *reque vp->op = map->op; if (fr_pair_value_from_str(vp, answer, -1, '"', false) < 0) { RPEDEBUG("Failed parsing exec output"); - fr_pair_list_free(&vp); + talloc_free(&vp); return -2; } fr_pair_add(&vps, vp); @@ -1051,7 +1051,7 @@ int map_to_vp(TALLOC_CTX *ctx, fr_pair_list_t *out, request_t *request, map_t co rcode = fr_pair_value_from_str(n, str, -1, '\0', false); talloc_free(str); if (rcode < 0) { - fr_pair_list_free(&n); + talloc_free(&n); goto error; } n->op = map->op; @@ -1170,7 +1170,7 @@ int map_to_vp(TALLOC_CTX *ctx, fr_pair_list_t *out, request_t *request, map_t co fr_assert(0); /* Should have been caught at parse time */ error: - fr_pair_list_free(&vp); + talloc_free(&vp); return rcode; } diff --git a/src/lib/util/struct.c b/src/lib/util/struct.c index cbf284fee89..44b5aae8d44 100644 --- a/src/lib/util/struct.c +++ b/src/lib/util/struct.c @@ -49,7 +49,7 @@ fr_pair_t *fr_raw_from_network(TALLOC_CTX *ctx, fr_dict_attr_t const *parent, ui if (!vp) return NULL; if (fr_value_box_from_network(vp, &vp->data, vp->da->type, vp->da, data, data_len, true) < 0) { - fr_pair_list_free(&vp); + talloc_free(vp); return NULL; } @@ -257,7 +257,7 @@ ssize_t fr_struct_from_network(TALLOC_CTX *ctx, fr_dcursor_t *cursor, */ if (fr_value_box_from_network(vp, &vp->data, vp->da->type, vp->da, p, child_length, true) < 0) { FR_PROTO_TRACE("fr_struct_from_network - failed decoding child VP"); - fr_pair_list_free(&vp); + talloc_free(vp); unknown: fr_pair_list_free(&head); diff --git a/src/protocols/radius/decode.c b/src/protocols/radius/decode.c index 7b0cd3b9779..12739e76882 100644 --- a/src/protocols/radius/decode.c +++ b/src/protocols/radius/decode.c @@ -1094,7 +1094,7 @@ ssize_t fr_radius_decode_pair_value(TALLOC_CTX *ctx, fr_cursor_t *cursor, fr_dic */ packet_ctx->tags = talloc_zero_array(NULL, fr_radius_tag_ctx_t *, 32); if (!packet_ctx->tags) { - fr_pair_list_free(&vp); + talloc_free(vp); fr_strerror_printf("%s: Internal sanity check %d", __FUNCTION__, __LINE__); return -1; } @@ -1108,21 +1108,21 @@ ssize_t fr_radius_decode_pair_value(TALLOC_CTX *ctx, fr_cursor_t *cursor, fr_dic packet_ctx->tags[tag] = talloc_zero(packet_ctx->tags, fr_radius_tag_ctx_t); if (!packet_ctx->tags[tag]) { - fr_pair_list_free(&vp); + talloc_free(vp); fr_strerror_printf("%s: Internal sanity check %d", __FUNCTION__, __LINE__); return -1; } group_da = fr_dict_attr_child_by_num(fr_dict_root(dict_radius), FR_TAG_BASE + tag); if (!group_da) { - fr_pair_list_free(&vp); + talloc_free(vp); fr_strerror_printf("Failed finding attribute 'Tag-%u'", tag); return -1; } group = fr_pair_afrom_da(ctx, group_da); if (!group) { - fr_pair_list_free(&vp); + talloc_free(vp); return -1; } @@ -1465,7 +1465,7 @@ ssize_t fr_radius_decode_pair_value(TALLOC_CTX *ctx, fr_cursor_t *cursor, fr_dic default: raw: - if (vp) fr_pair_list_free(&vp); + if (vp) talloc_free(vp); vp = fr_raw_from_network(ctx, parent, data, attr_len); tag = 0; @@ -1577,7 +1577,7 @@ ssize_t fr_radius_decode_pair_value(TALLOC_CTX *ctx, fr_cursor_t *cursor, fr_dic * Paranoid loop prevention */ if (vp->da->flags.is_unknown) { - fr_pair_list_free(&vp); + talloc_free(vp); return -1; } goto raw;