]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
use request_ctx for reply and reply_pairs
authorAlan T. DeKok <aland@freeradius.org>
Sat, 30 Mar 2024 19:58:45 +0000 (15:58 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Sat, 30 Mar 2024 22:13:47 +0000 (18:13 -0400)
we really need a better way to allocate these.  Perhaps the caller
should always just pre-allocate the reply?

src/protocols/radius/client.c

index 1f40dbcb535e50f7221622e58dc2490a1b6d00b5..0cc90c8e4bc9cfe0d9c2a1507876a89b244a7795 100644 (file)
@@ -294,7 +294,7 @@ int fr_radius_client_fd_bio_cancel(fr_bio_packet_t *bio, fr_packet_t *packet)
 }
 
 int fr_radius_client_fd_bio_read(fr_bio_packet_t *bio, void **request_ctx_p, fr_packet_t **packet_p,
-                                TALLOC_CTX *out_ctx, fr_pair_list_t *out)
+                                UNUSED TALLOC_CTX *out_ctx, fr_pair_list_t *out)
 {
        ssize_t slen;
        fr_radius_client_fd_bio_t *my = talloc_get_type_abort(bio, fr_radius_client_fd_bio_t);
@@ -329,7 +329,7 @@ int fr_radius_client_fd_bio_read(fr_bio_packet_t *bio, void **request_ctx_p, fr_
        /*
         *      Allocate the new request data structure
         */
-       reply = fr_packet_alloc(id_ctx->packet, false);
+       reply = fr_packet_alloc(id_ctx->request_ctx, false);
        if (!reply) return -1;
 
        id_ctx->response = reply;
@@ -354,7 +354,7 @@ int fr_radius_client_fd_bio_read(fr_bio_packet_t *bio, void **request_ctx_p, fr_
        /*
         *      If this fails, we're out of memory.
         */
-       if (fr_radius_decode_simple(out_ctx, out, reply->data, reply->data_len,
+       if (fr_radius_decode_simple(id_ctx->request_ctx, out, reply->data, reply->data_len,
                                    id_ctx->packet->vector, (char const *) my->cfg.verify.secret) < 0) {
                fr_assert(0);
        }