]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Fix for CID #1529242 and improve comment about query freeing
authorNick Porter <nick@portercomputing.co.uk>
Sat, 20 May 2023 19:54:46 +0000 (20:54 +0100)
committerNick Porter <nick@portercomputing.co.uk>
Sat, 20 May 2023 20:52:48 +0000 (21:52 +0100)
src/lib/ldap/connection.c

index dedf3cf55b3774497d943f70ef2bd60e244a26a2..154b68b4f7c094d171ad758982a86bdb1c8b0118 100644 (file)
@@ -928,13 +928,18 @@ static void ldap_trunk_request_demux(fr_event_list_t *el, fr_trunk_connection_t
                if (query->parser) query->parser(ldap_conn->handle, query, result, query->treq->rctx);
 
                /*
-                *      Mark the trunk request as complete and set the request as runnable
+                *      Set the request as runnable
                 */
-               if (query->treq->request) unlang_interpret_mark_runnable(query->treq->request);
+               if (request) unlang_interpret_mark_runnable(request);
 
                /*
-                *      If the query is parented off just the treq, then it will be freed when
-                *      the request is completed.  If it has other parenting, then it will not.
+                *      If referral following failed, there is no active trunk request.
+                */
+               if (!query->treq) continue;
+
+               /*
+                *      If the query is parented off the treq then it will be freed when
+                *      the request is completed.  If it is parented by something else then it will not.
                 */
                treq = query->treq;
                query->treq = NULL;