]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Off by one
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 3 Nov 2021 18:59:13 +0000 (14:59 -0400)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 3 Nov 2021 18:59:13 +0000 (14:59 -0400)
src/modules/rlm_ldap/rlm_ldap.c

index 53659c0995b78dfb0a4389a86be1952399fba992..12e7c295859bfe9f1c5aebcd67e1aa1feb563aac 100644 (file)
@@ -1815,7 +1815,7 @@ static int mod_thread_detach(UNUSED fr_event_list_t *el, void *thread)
 
        if (fr_rb_flatten_inorder(NULL, &trunks_to_free, this_thread->trunks) < 0) return -1;
 
-       for (i = talloc_array_length(trunks_to_free); i >= 0; i--) talloc_free(trunks_to_free[i]);
+       for (i = talloc_array_length(trunks_to_free) - 1; i >= 0; i--) talloc_free(trunks_to_free[i]);
        talloc_free(trunks_to_free);
        talloc_free(this_thread->trunks);