]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Use correct free routine for individual vps
authorNick Porter <nick@portercomputing.co.uk>
Tue, 22 Dec 2020 17:43:14 +0000 (17:43 +0000)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 21 Jan 2021 23:05:49 +0000 (23:05 +0000)
src/lib/server/map.c
src/lib/util/struct.c
src/protocols/radius/decode.c

index f12f4fe33783798c1b915d02c94998505ebcea2b..3fe73924333ca777db09ba4a867c88d5b4d48e9f 100644 (file)
@@ -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;
        }
 
index cbf284fee89b272f622ea12b6e2b1d3092d5ff7f..44b5aae8d44526f102857822264f39558f870a81 100644 (file)
@@ -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);
 
index 7b0cd3b9779d3d58948d856cc878dcde4b0374e6..12739e7688283d3b79d99f435e4b897612bd0bd3 100644 (file)
@@ -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;