diff --git a/servers/slapd/back-ldap/bind.c b/servers/slapd/back-ldap/bind.c
index 2afe5f11df630772e9d572df128ad93bcc444de5..bc0b3d9a3c51e5c272efc4b67c922b1612d0af5e 100644
--- a/servers/slapd/back-ldap/bind.c
+++ b/servers/slapd/back-ldap/bind.c
@@ -2644,7 +2644,7 @@ ldap_back_controls_free( Operation *op, SlapReply *rs, LDAPControl ***pctrls )
 	/* we assume that the controls added by the proxy come first,
 	 * so as soon as we find op->o_ctrls[ 0 ] we can stop */
 	if ( ctrls && ctrls != op->o_ctrls ) {
-		int	i, n = 0, n_added;
+		int	i = 0, n = 0, n_added;
 		void	*lower, *upper;
 
 		assert( ctrls[ 0 ] != NULL );