From: Alan T. DeKok Date: Wed, 18 May 2022 00:30:50 +0000 (-0400) Subject: Revert "clean up internal requests if they have no parent" X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4f0f1f70deaf79ddebe76de8b65d588a5fa6d8fe;p=thirdparty%2Ffreeradius-server.git Revert "clean up internal requests if they have no parent" This reverts commit 9f8b9bb3ad94687b378f5539a1010310a089bc80. the interpreter should still clean up some requests which have no parent, as there are very much cases where those are leaked. however, until we track all of those issues down, let's not break CI --- diff --git a/src/lib/io/worker.c b/src/lib/io/worker.c index 781c2394ac5..a5de9fc2fcf 100644 --- a/src/lib/io/worker.c +++ b/src/lib/io/worker.c @@ -996,8 +996,7 @@ static void _worker_request_done_external(request_t *request, UNUSED rlm_rcode_t /** Internal request (i.e. one generated by the interpreter) is now complete * - * Whatever generated the request is now responsible for freeing it, - * unless there's no talloc parent. In which case we have to free it. + * Whatever generated the request is now responsible for freeing it. */ static void _worker_request_done_internal(request_t *request, UNUSED rlm_rcode_t rcode, void *uctx) { @@ -1007,8 +1006,6 @@ static void _worker_request_done_internal(request_t *request, UNUSED rlm_rcode_t fr_assert(!fr_heap_entry_inserted(request->runnable_id)); fr_assert(!fr_minmax_heap_entry_inserted(request->time_order_id)); - - if (!talloc_parent(request)) talloc_free(request); } /** Detached request (i.e. one generated by the interpreter with no parent) is now complete diff --git a/src/lib/server/trigger.c b/src/lib/server/trigger.c index 8a999f67235..c8f5fcee1b1 100644 --- a/src/lib/server/trigger.c +++ b/src/lib/server/trigger.c @@ -457,10 +457,11 @@ int trigger_exec(unlang_interpret_t *intp, * shutting down. */ unlang_interpret_synchronous(NULL, request); + talloc_free(request); } /* - * Otherwise the worker cleans up the request. + * Otherwise the worker cleans up the request request. */ return 0; } diff --git a/src/lib/unlang/interpret_synchronous.c b/src/lib/unlang/interpret_synchronous.c index 89218a7b524..60127080392 100644 --- a/src/lib/unlang/interpret_synchronous.c +++ b/src/lib/unlang/interpret_synchronous.c @@ -71,14 +71,12 @@ static void _request_done_external(request_t *request, UNUSED rlm_rcode_t rcode, /** Internal request (i.e. one generated by the interpreter) is now complete * - * Whatever generated the request is now responsible for freeing it, - * unless there's no talloc parent. In which case we have to free it. */ static void _request_done_internal(request_t *request, UNUSED rlm_rcode_t rcode, UNUSED void *uctx) { RDEBUG3("Done synchronous internal request"); - if (!talloc_parent(request)) talloc_free(request); + /* Request will be cleaned up by whatever created it */ } static void _request_done_detached(request_t *request, UNUSED rlm_rcode_t rcode, UNUSED void *uctx)