X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fschemaparse.c;h=900263c84aaa000056f1d0b32fd238a2d4265ab5;hb=8a5bbf9b0808a17543cd7141623a91a79c633232;hp=180ed71d005caeca8636e3c0336294756ef91b43;hpb=42e0d83cb3a1a1c5b25183f1ab74ce7edbe25de7;p=openldap diff --git a/servers/slapd/schemaparse.c b/servers/slapd/schemaparse.c index 180ed71d00..900263c84a 100644 --- a/servers/slapd/schemaparse.c +++ b/servers/slapd/schemaparse.c @@ -1,18 +1,18 @@ /* schemaparse.c - routines to parse config file objectclass definitions */ +#include "portable.h" + #include -#include -#include -#include -#include "slap.h" -extern char **str2charray(); -extern void charray_merge(); +#include +#include + +#include "slap.h" struct objclass *global_oc; int global_schemacheck; -static void oc_usage(); +static void oc_usage(void); void parse_oc( @@ -29,16 +29,17 @@ parse_oc( struct objclass **ocp; oc = (struct objclass *) ch_calloc( 1, sizeof(struct objclass) ); - oc->oc_name = strdup( argv[1] ); + oc->oc_name = ch_strdup( argv[1] ); for ( i = 2; i < argc; i++ ) { /* required attributes */ if ( strcasecmp( argv[i], "requires" ) == 0 ) { do { i++; if ( i < argc ) { + char **s = str2charray( argv[i], "," ); last = argv[i][strlen( argv[i] ) - 1]; - charray_merge( &oc->oc_required, - str2charray( argv[i], "," ) ); + charray_merge( &oc->oc_required, s ); + charray_free( s ); } } while ( i < argc && last == ',' ); @@ -47,9 +48,11 @@ parse_oc( do { i++; if ( i < argc ) { + char **s = str2charray( argv[i], "," ); last = argv[i][strlen( argv[i] ) - 1]; - charray_merge( &oc->oc_allowed, - str2charray( argv[i], "," ) ); + + charray_merge( &oc->oc_allowed, s ); + charray_free( s ); } } while ( i < argc && last == ',' ); @@ -69,7 +72,7 @@ parse_oc( } static void -oc_usage() +oc_usage( void ) { fprintf( stderr, " ::= objectclass \n" ); fprintf( stderr, " [ requires ]\n" );