]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Revert "clean up internal requests if they have no parent"
authorAlan T. DeKok <aland@freeradius.org>
Wed, 18 May 2022 00:30:50 +0000 (20:30 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 18 May 2022 00:30:50 +0000 (20:30 -0400)
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

src/lib/io/worker.c
src/lib/server/trigger.c
src/lib/unlang/interpret_synchronous.c

index 781c2394ac5b673c6d397554fbb0016655fed2a8..a5de9fc2fcf03930b6fd486eb62be4c6e6dda45a 100644 (file)
@@ -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
index 8a999f672353584540f48d28dfb2e6e8c3495982..c8f5fcee1b182328afdc3b63faff43b506bab0ad 100644 (file)
@@ -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;
 }
index 89218a7b524b2f884207ec0421723e210acd8e90..601270803921e058edca2af27750dac926e2c89c 100644 (file)
@@ -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)