From: Alan T. DeKok Date: Sun, 15 Feb 2026 16:33:06 +0000 (-0500) Subject: various bug fixes in subrequest.c X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1825eb32ea9f9825f00147e667fc07cd3b3bbd6c;p=thirdparty%2Ffreeradius-server.git various bug fixes in subrequest.c free child for completeness if we fail to start the child, then we had pushed a frame in the parent which is now invalid. So we mark that frame as unwinding which does little more than reduce maximum memory pressure, as it was parented from "request" --- diff --git a/src/lib/unlang/subrequest.c b/src/lib/unlang/subrequest.c index 90229b619fc..1646b3c4b2f 100644 --- a/src/lib/unlang/subrequest.c +++ b/src/lib/unlang/subrequest.c @@ -192,6 +192,7 @@ static unlang_action_t unlang_subrequest_init(unlang_result_t *p_result, request child = unlang_io_subrequest_alloc(request, gext->dict, UNLANG_DETACHABLE); if (!child) { fail: + talloc_free(child); return UNLANG_ACTION_FAIL; } /* @@ -473,7 +474,10 @@ int unlang_subrequest_child_push(unlang_result_t *p_result, request_t *child, vo * This instruction will mark the parent as runnable * when it executed. */ - if (unlang_child_request_init(cr, cr, child, p_result, NULL, unique_session_ptr, free_child) < 0) return -1; + if (unlang_child_request_init(cr, cr, child, p_result, NULL, unique_session_ptr, free_child) < 0) { + unwind_set(frame); + return -1; + } return 0; }