]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-ldap/config.c
Reverse last commit. Wrong tree.
[openldap] / servers / slapd / back-ldap / config.c
index 6dd8363a19b3a0cb771adb986b98d2ca739a84eb..38c9a95296473d0a1e571c003b54144226b71ef7 100644 (file)
@@ -314,6 +314,10 @@ ldap_back_cf_gen( ConfigArgs *c )
                struct berval   bv = BER_BVNULL;
                rc = 0;
 
+               if ( li == NULL ) {
+                       return 1;
+               }
+
                switch( c->type ) {
                case LDAP_BACK_CFG_URI:
                        if ( li->li_uri != NULL ) {
@@ -349,7 +353,7 @@ ldap_back_cf_gen( ConfigArgs *c )
 
                        bindconf_unparse( &li->li_acl, &bv );
 
-                       for ( i = 0; isspace( bv.bv_val[ i ] ); i++ )
+                       for ( i = 0; isspace( (unsigned char) bv.bv_val[ i ] ); i++ )
                                /* count spaces */ ;
 
                        if ( i ) {
@@ -484,7 +488,7 @@ ldap_back_cf_gen( ConfigArgs *c )
                                bv.bv_len = ptr - bv.bv_val;
 
                        } else {
-                               for ( i = 0; isspace( bc.bv_val[ i ] ); i++ )
+                               for ( i = 0; isspace( (unsigned char) bc.bv_val[ i ] ); i++ )
                                        /* count spaces */ ;
 
                                if ( i ) {
@@ -543,7 +547,7 @@ ldap_back_cf_gen( ConfigArgs *c )
                                return 1;
                        }
 
-                       for ( i = 0; isspace( bv.bv_val[ i ] ); i++ )
+                       for ( i = 0; isspace( (unsigned char) bv.bv_val[ i ] ); i++ )
                                /* count spaces */ ;
 
                        if ( i ) {
@@ -1101,6 +1105,7 @@ done_url:;
                                                        "unknown flag \"%s\"",
                                                        flags[ j ] );
                                                Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->msg, 0 );
+                                               ldap_charray_free( flags );
                                                return 1;
                                        }
                                }
@@ -1153,7 +1158,7 @@ done_url:;
 
        case LDAP_BACK_CFG_TIMEOUT:
                for ( i = 1; i < c->argc; i++ ) {
-                       if ( isdigit( c->argv[ i ][ 0 ] ) ) {
+                       if ( isdigit( (unsigned char) c->argv[ i ][ 0 ] ) ) {
                                int             j;
                                unsigned        u;