X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fschemaparse.c;h=900263c84aaa000056f1d0b32fd238a2d4265ab5;hb=ceb1c5ce1c22a1e062cf724d222b126751e2906a;hp=96e01f09b0afa5ea0e2d454b5b5925ee0e02b0fb;hpb=3952bc8e95a2b21aced14f890028f12d00e191fa;p=openldap diff --git a/servers/slapd/schemaparse.c b/servers/slapd/schemaparse.c index 96e01f09b0..900263c84a 100644 --- a/servers/slapd/schemaparse.c +++ b/servers/slapd/schemaparse.c @@ -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 == ',' );