]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Check fr_event_timer_in() return value (CID #1503926) (#4774)
authorJames Jones <jejones3141@gmail.com>
Fri, 21 Oct 2022 17:50:25 +0000 (12:50 -0500)
committerGitHub <noreply@github.com>
Fri, 21 Oct 2022 17:50:25 +0000 (13:50 -0400)
* Check fr_event_timer_in() return value (CID #1503926)

* Assert and error if we can't insert timer events

Co-authored-by: Arran Cudbard-Bell <a.cudbardb@freeradius.org>
src/lib/ldap/connection.c

index d3bc487d264b040ca9bc5d6a2beb837b3daad741..f7ed270cf68d5d775809207ab93f45043ace7b5e 100644 (file)
@@ -967,8 +967,8 @@ fr_ldap_thread_trunk_t *fr_thread_ldap_trunk_get(fr_ldap_thread_t *thread, char
        /*
         *  Insert event to close trunk if it becomes idle
         */
-       fr_event_timer_in(found, thread->el, &found->ev, thread->config->idle_timeout,
-                         _ldap_trunk_idle_timeout, found);
+       if (!fr_cond_assert_msg(fr_event_timer_in(found, thread->el, &found->ev, thread->config->idle_timeout,
+                                                 _ldap_trunk_idle_timeout, found) == 0, "cannot insert trunk idle event")) goto error;
 
        /*
         *      Attempt to discover what type directory we are talking to