]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/controls.c
Merged in preliminary support for Cyrus SASL library;
[openldap] / libraries / libldap / controls.c
index c84ac8847801e46dcf3510ff007b806aec5befe2..cab753e8810a00b3d20ccf2de46a485d66b16e5b 100644 (file)
@@ -1,3 +1,4 @@
+/* $OpenLDAP$ */
 /*
  * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
@@ -150,7 +151,7 @@ int ldap_int_get_controls(
                return LDAP_NO_MEMORY;
        }
 
-       ctrls[nctrls] = NULL;
+       *ctrls[nctrls] = NULL;
 
        for( tag = ber_first_element( ber, &len, &opaque );
                tag != LBER_ERROR;
@@ -249,10 +250,10 @@ ldap_controls_free( LDAPControl **controls )
        assert( controls != NULL );
 
        if ( controls != NULL ) {
-               LDAPControl *c;
+               int i;
 
-               for(c = *controls; c != NULL; c++) {
-                       ldap_control_free( c );
+               for( i=0; controls[i] != NULL; i++) {
+                       ldap_control_free( controls[i] );
                }
 
                LDAP_FREE( controls );