From: Arran Cudbard-Bell Date: Wed, 3 Nov 2021 18:59:13 +0000 (-0400) Subject: Off by one X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=df3bdaed6e9c290f0981f5992bc1c8bc2c26d212;p=thirdparty%2Ffreeradius-server.git Off by one --- diff --git a/src/modules/rlm_ldap/rlm_ldap.c b/src/modules/rlm_ldap/rlm_ldap.c index 53659c0995b..12e7c295859 100644 --- a/src/modules/rlm_ldap/rlm_ldap.c +++ b/src/modules/rlm_ldap/rlm_ldap.c @@ -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);