From: Alan T. DeKok Date: Wed, 2 Jul 2025 11:48:22 +0000 (-0400) Subject: "frame" is not talloc'd X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a36c396ef0a0ab111f4e8c42aa3c65f6c6d643ef;p=thirdparty%2Ffreeradius-server.git "frame" is not talloc'd --- diff --git a/src/lib/unlang/interpret.c b/src/lib/unlang/interpret.c index 409bfbb8ed..1003bc9a6b 100644 --- a/src/lib/unlang/interpret.c +++ b/src/lib/unlang/interpret.c @@ -1506,11 +1506,15 @@ int unlang_interpret_set_timeout(request_t *request, fr_time_delta_t timeout) unlang_stack_t *stack = request->stack; unlang_stack_frame_t *frame = &stack->frame[stack->depth]; unlang_retry_t *retry; + TALLOC_CTX *frame_ctx; fr_assert(!frame->retry); fr_assert(fr_time_delta_ispos(timeout)); - frame->retry = retry = talloc_zero(frame, unlang_retry_t); + frame_ctx = frame->state; + if (!frame_ctx) frame_ctx = stack; + + frame->retry = retry = talloc_zero(frame_ctx, unlang_retry_t); if (!frame->retry) return -1; retry->request = request; diff --git a/src/lib/unlang/unlang_priv.h b/src/lib/unlang/unlang_priv.h index 92aa232af9..273fe2f570 100644 --- a/src/lib/unlang/unlang_priv.h +++ b/src/lib/unlang/unlang_priv.h @@ -612,6 +612,7 @@ static inline void frame_cleanup(unlang_stack_frame_t *frame) * Don't clear top_frame flag, bad things happen... */ frame->flag &= UNLANG_FRAME_FLAG_TOP_FRAME; + TALLOC_FREE(frame->retry); if (frame->state) { talloc_free_children(frame->state); /* *(ev->parent) = NULL in event.c */ TALLOC_FREE(frame->state);