handle when URIs are null

This commit is contained in:
Pierangelo Masarati 2005-12-26 16:55:50 +00:00
parent dc166c08b8
commit 0fa9578f48

View File

@ -361,29 +361,8 @@ monitor_subsys_database_init(
li->li_bvuri, NULL );
#else
char **urls = ldap_str2charray( li->li_uri, " " );
int u;
for ( u = 0; urls[ u ] != NULL; u++ ) {
struct berval bv;
ber_str2bv( urls[ u ], 0, 0, &bv );
attr_merge_normalize_one( e,
slap_schema.si_ad_labeledURI,
&bv, NULL );
}
ldap_charray_free( urls );
#endif
#endif /* defined(SLAPD_LDAP) */
#if defined(SLAPD_META)
} else if ( strcmp( bi->bi_type, "meta" ) == 0 ) {
metainfo_t *mi = (metainfo_t *)be->be_private;
int t;
for ( t = 0; t < mi->mi_ntargets; t++ ) {
char **urls = ldap_str2charray( mi->mi_targets[ t ].mt_uri, " " );
if ( urls != NULL ) {
int u;
for ( u = 0; urls[ u ] != NULL; u++ ) {
@ -395,8 +374,35 @@ monitor_subsys_database_init(
slap_schema.si_ad_labeledURI,
&bv, NULL );
}
ldap_charray_free( urls );
}
#endif
#endif /* defined(SLAPD_LDAP) */
#if defined(SLAPD_META)
} else if ( strcmp( bi->bi_type, "meta" ) == 0 ) {
metainfo_t *mi = (metainfo_t *)be->be_private;
int t;
for ( t = 0; t < mi->mi_ntargets; t++ ) {
char **urls = ldap_str2charray( mi->mi_targets[ t ].mt_uri, " " );
if ( urls != NULL ) {
int u;
for ( u = 0; urls[ u ] != NULL; u++ ) {
struct berval bv;
ber_str2bv( urls[ u ], 0, 0, &bv );
attr_merge_normalize_one( e,
slap_schema.si_ad_labeledURI,
&bv, NULL );
}
ldap_charray_free( urls );
}
}
#endif /* defined(SLAPD_META) */
}