return( 0 );
}
- edn = dn_normalize_case( strdup( e->e_dn ) );
+ edn = dn_normalize_case( ch_strdup( e->e_dn ) );
Debug( LDAP_DEBUG_ACL, "\n=> access_allowed: entry (%s) attr (%s)\n",
e->e_dn, attr, 0 );
odn = NULL;
if ( op->o_dn != NULL ) {
- odn = dn_normalize_case( strdup( op->o_dn ) );
+ odn = dn_normalize_case( ch_strdup( op->o_dn ) );
bv.bv_val = odn;
bv.bv_len = strlen( odn );
}
struct acl *a;
char *edn;
- edn = dn_normalize_case( strdup( e->e_dn ) );
+ edn = dn_normalize_case( ch_strdup( e->e_dn ) );
for ( ; mods != NULL; mods = mods->mod_next ) {
regmatch_t matches[MAXREMATCHES];
fname, lineno, right, buf );
acl_usage();
}
- a->acl_dnpat = strdup( ".*" );
+ a->acl_dnpat = ch_strdup( ".*" );
continue;
}
acl_usage();
} else {
- a->acl_dnpat = dn_upcase(strdup( right ));
+ a->acl_dnpat = dn_upcase(ch_strdup( right ));
}
} else if ( strncasecmp( left, "attr", 4 )
== 0 ) {
/* get <who> */
split( argv[i], '=', &left, &right );
if ( strcasecmp( argv[i], "*" ) == 0 ) {
- b->a_dnpat = strdup( ".*" );
+ b->a_dnpat = ch_strdup( ".*" );
} else if ( strcasecmp( argv[i], "self" ) == 0 ) {
- b->a_dnpat = strdup( "self" );
+ b->a_dnpat = ch_strdup( "self" );
} else if ( strcasecmp( left, "dn" ) == 0 ) {
regtest(fname, lineno, right);
- b->a_dnpat = dn_upcase( strdup( right ) );
+ b->a_dnpat = dn_upcase( ch_strdup( right ) );
} else if ( strcasecmp( left, "dnattr" ) == 0 ) {
- b->a_dnattr = strdup( right );
+ b->a_dnattr = ch_strdup( right );
#ifdef SLAPD_ACLGROUPS
} else if ( strcasecmp( left, "group" ) == 0 ) {
*name++ = '\0';
}
- b->a_group = dn_upcase(strdup( right ));
+ b->a_group = dn_upcase(ch_strdup( right ));
if (value && *value) {
- b->a_objectclassvalue = strdup(value);
+ b->a_objectclassvalue = ch_strdup(value);
*--value = '/';
}
else
- b->a_objectclassvalue = strdup("groupOfNames");
+ b->a_objectclassvalue = ch_strdup("groupOfNames");
if (name && *name) {
- b->a_groupattrname = strdup(name);
+ b->a_groupattrname = ch_strdup(name);
*--name = '/';
}
else
- b->a_groupattrname = strdup("member");
+ b->a_groupattrname = ch_strdup("member");
} else if ( strcasecmp( left, "domain" ) == 0 ) {
char *s;
regtest(fname, lineno, right);
- b->a_domainpat = strdup( right );
+ b->a_domainpat = ch_strdup( right );
/* normalize the domain */
for ( s = b->a_domainpat; *s; s++ ) {
}
} else if ( strcasecmp( left, "addr" ) == 0 ) {
regtest(fname, lineno, right);
- b->a_addrpat = strdup( right );
+ b->a_addrpat = ch_strdup( right );
} else {
fprintf( stderr,
"%s: line %d: expecting <who> got \"%s\"\n",
return;
}
e->e_dn = dn;
- dn = dn_normalize( strdup( dn ) );
+ dn = dn_normalize( ch_strdup( dn ) );
Debug( LDAP_DEBUG_ARGS, " do_add: dn (%s)\n", dn, 0, 0 );
/* get the attrs */
if ( **a == NULL ) {
**a = (Attribute *) ch_malloc( sizeof(Attribute) );
- (**a)->a_type = attr_normalize( strdup( type ) );
+ (**a)->a_type = attr_normalize( ch_strdup( type ) );
(**a)->a_vals = NULL;
(**a)->a_syntax = attr_syntax( type );
(**a)->a_next = NULL;
if ( *a == NULL ) {
*a = (Attribute *) ch_malloc( sizeof(Attribute) );
- (*a)->a_type = attr_normalize( strdup( type ) );
+ (*a)->a_type = attr_normalize( ch_strdup( type ) );
(*a)->a_vals = NULL;
(*a)->a_syntax = attr_syntax( type );
(*a)->a_next = NULL;
Entry *p = NULL;
int rc;
- dn = dn_normalize( strdup( e->e_dn ) );
+ dn = dn_normalize( ch_strdup( e->e_dn ) );
Debug(LDAP_DEBUG_ARGS, "==> ldbm_back_add: %s\n", dn, 0, 0);
Debug( LDAP_DEBUG_TRACE, "<= %s is an alias for %s\n",
e->e_dn, a->a_vals[0]->bv_val, 0 );
- newDN = strdup (a->a_vals[0]->bv_val);
- oldDN = strdup (e->e_dn);
+ newDN = ch_strdup (a->a_vals[0]->bv_val);
+ oldDN = ch_strdup (e->e_dn);
/*
* ok, so what happens if there is an alias in the DN of a dereferenced
"<= dereferencing dn %s\n",
dn, 0, 0 );
- newDN = strdup ( dn );
+ newDN = ch_strdup ( dn );
/* while we don't have a matched dn, deref the DN */
for ( depth = 0;
if ( (eNew = dn2entry_r( be, newDN, &matched )) != NULL) {
if ((eDeref = derefAlias_r( be, conn, op, eNew )) != NULL) {
free (newDN);
- newDN = strdup (eDeref->e_dn);
+ newDN = ch_strdup (eDeref->e_dn);
/* free reader lock */
cache_return_entry_r(&li->li_cache, eDeref);
}
}
if (newDN == NULL) {
- newDN = strdup ( dn );
+ newDN = ch_strdup ( dn );
}
Debug( LDAP_DEBUG_TRACE, "<= returning deref DN of %s\n", newDN, 0, 0 );
}
for ( i = 0; attrs[i] != NULL; i++ ) {
a = (struct attrinfo *) ch_malloc( sizeof(struct attrinfo) );
- a->ai_type = strdup( attrs[i] );
+ a->ai_type = ch_strdup( attrs[i] );
a->ai_syntaxmask = attr_syntax( a->ai_type );
if ( argc == 1 ) {
a->ai_indexmask = (INDEX_PRESENCE | INDEX_EQUALITY |
fname, lineno );
exit( 1 );
}
- li->li_directory = strdup( argv[1] );
+ li->li_directory = ch_strdup( argv[1] );
/* mode with which to create new database files */
} else if ( strcasecmp( argv[0], "mode" ) == 0 ) {
pthread_mutex_unlock( &li->li_dbcache_mutex );
return( NULL );
}
- li->li_dbcache[i].dbc_name = strdup( buf );
+ li->li_dbcache[i].dbc_name = ch_strdup( buf );
li->li_dbcache[i].dbc_refcnt = 1;
li->li_dbcache[i].dbc_lastref = curtime;
if ( stat( buf, &st ) == 0 ) {
return( -1 );
}
- dn = strdup( dn );
+ dn = ch_strdup( dn );
dn_normalize_case( dn );
key.dptr = dn;
memset( &data, 0, sizeof( data ) );
#endif
- dn = strdup( dn );
+ dn = ch_strdup( dn );
Debug( LDAP_DEBUG_TRACE, "=> dn2id( \"%s\" )\n", dn, 0, 0 );
dn_normalize_case( dn );
* with index_add_values() call
*/
- bv.bv_val = strdup( e->e_dn );
+ bv.bv_val = ch_strdup( e->e_dn );
bv.bv_len = strlen( bv.bv_val );
(void) dn_normalize_case( bv.bv_val );
bvals[0] = &bv;
attr_index_config( li, "ldbm id2children initialization", 0, 2, argv,
1 );
argv[ 0 ] = "objectclass";
- argv[ 1 ] = strdup( "pres,eq" );
+ argv[ 1 ] = ch_strdup( "pres,eq" );
argv[ 2 ] = NULL;
attr_index_config( li, "ldbm objectclass initialization", 0, 2, argv,
1 );
strcat( newdn, pdn );
}
} else {
- newdn = strdup( newrdn );
+ newdn = ch_strdup( newrdn );
}
(void) dn_normalize( newdn );
* check and apply aliasing where the dereferencing applies to
* the subordinates of the base
*/
- realBase = strdup (base);
+
switch ( deref ) {
case LDAP_DEREF_FINDING:
case LDAP_DEREF_ALWAYS:
free (realBase);
realBase = derefDN ( be, conn, op, base );
break;
+ default:
+ realBase = ch_strdup(base);
}
(void) dn_normalize (realBase);
}
free( dn );
} else if ( scope == LDAP_SCOPE_SUBTREE ) {
- dn = strdup( e->e_dn );
+ dn = ch_strdup( e->e_dn );
(void) dn_normalize( dn );
scopeok = dn_issuffix( dn, realBase );
free( dn );
f->f_choice = LDAP_FILTER_AND;
f->f_and = (Filter *) ch_malloc( sizeof(Filter) );
f->f_and->f_choice = LDAP_FILTER_EQUALITY;
- f->f_and->f_ava.ava_type = strdup( "id2children" );
+ f->f_and->f_ava.ava_type = ch_strdup( "id2children" );
sprintf( buf, "%ld", e != NULL ? e->e_id : 0 );
- f->f_and->f_ava.ava_value.bv_val = strdup( buf );
+ f->f_and->f_ava.ava_value.bv_val = ch_strdup( buf );
f->f_and->f_ava.ava_value.bv_len = strlen( buf );
f->f_and->f_next = filter;
f->f_choice = LDAP_FILTER_OR;
f->f_or = (Filter *) ch_malloc( sizeof(Filter) );
f->f_or->f_choice = LDAP_FILTER_EQUALITY;
- f->f_or->f_avtype = strdup( "objectclass" );
+ f->f_or->f_avtype = ch_strdup( "objectclass" );
/* Patch to use normalized uppercase */
- f->f_or->f_avvalue.bv_val = strdup( "REFERRAL" );
+ f->f_or->f_avvalue.bv_val = ch_strdup( "REFERRAL" );
f->f_or->f_avvalue.bv_len = strlen( "REFERRAL" );
f->f_or->f_next = filter;
filter = f;
f->f_choice = LDAP_FILTER_AND;
f->f_and = (Filter *) ch_malloc( sizeof(Filter) );
f->f_and->f_choice = LDAP_FILTER_SUBSTRINGS;
- f->f_and->f_sub_type = strdup( "dn" );
+ f->f_and->f_sub_type = ch_strdup( "dn" );
f->f_and->f_sub_initial = NULL;
f->f_and->f_sub_any = NULL;
- f->f_and->f_sub_final = strdup( base );
+ f->f_and->f_sub_final = ch_strdup( base );
value_normalize( f->f_and->f_sub_final, SYNTAX_CIS );
f->f_and->f_next = filter;
filter = f;
fname, lineno );
exit( 1 );
}
- be->be_private = strdup( argv[1] );
+ be->be_private = ch_strdup( argv[1] );
#else /* HAVE_SETPWFILE */
fprintf( stderr,
"%s: line %d: ignoring \"file\" option (not supported on this platform)\n",
e->e_attrs = NULL;
sprintf( buf, "%s@%s", pw->pw_name, be->be_suffix[0] );
- e->e_dn = strdup( buf );
+ e->e_dn = ch_strdup( buf );
val.bv_val = pw->pw_name;
val.bv_len = strlen( pw->pw_name );
if ( conn->c_dn != NULL ) {
free( conn->c_dn );
}
- conn->c_dn = strdup( dn );
+ conn->c_dn = ch_strdup( dn );
pthread_mutex_unlock( &conn->c_dnmutex );
/* send this here to avoid a race condition */
#include "portable.h"
#include <stdio.h>
+#include <stdlib.h>
#include <ac/string.h>
#include <ac/socket.h>
return( new );
}
+
+char *
+ch_strdup(
+ const char *string
+)
+{
+ char *new;
+
+ if ( (new = strdup( string )) == NULL ) {
+ Debug( LDAP_DEBUG_ANY, "strdup(%s) failed\n", string, 0, 0 );
+ exit( 1 );
+ }
+
+ return( new );
+}
+
new = (char **) ch_malloc( (i + 1) * sizeof(char *) );
for ( i = 0; a[i] != NULL; i++ ) {
- new[i] = strdup( a[i] );
+ new[i] = ch_strdup( a[i] );
}
new[i] = NULL;
int i;
/* protect the input string from strtok */
- str = strdup( str );
+ str = ch_strdup( str );
i = 1;
for ( s = str; *s; s++ ) {
i = 0;
for ( s = strtok( str, brkstr ); s != NULL; s = strtok( NULL,
brkstr ) ) {
- res[i++] = strdup( s );
+ res[i++] = ch_strdup( s );
}
res[i] = NULL;
"%s: line %d: suffix line must appear inside a database definition (ignored)\n",
fname, lineno, 0 );
} else {
- dn = strdup( cargv[1] );
+ dn = ch_strdup( cargv[1] );
(void) dn_normalize( dn );
charray_add( &be->be_suffix, dn );
}
"%s: line %d: suffixAlias line must appear inside a database definition (ignored)\n",
fname, lineno, 0 );
} else {
- dn = strdup( cargv[1] );
+ dn = ch_strdup( cargv[1] );
(void) dn_normalize( dn );
charray_add( &be->be_suffixAlias, dn );
- dn = strdup( cargv[2] );
+ dn = ch_strdup( cargv[2] );
(void) dn_normalize( dn );
charray_add( &be->be_suffixAlias, dn );
}
"%s: line %d: rootdn line must appear inside a database definition (ignored)\n",
fname, lineno, 0 );
} else {
- dn = strdup( cargv[1] );
+ dn = ch_strdup( cargv[1] );
(void) dn_normalize( dn );
be->be_rootdn = dn;
}
"%s: line %d: rootpw line must appear inside a database definition (ignored)\n",
fname, lineno, 0 );
} else {
- be->be_rootpw = strdup( cargv[1] );
+ be->be_rootpw = ch_strdup( cargv[1] );
}
/* make this database read-only */
if ( strncasecmp( cargv[i], "host=", 5 )
== 0 ) {
charray_add( &be->be_replica,
- strdup( cargv[i] + 5 ) );
+ ch_strdup( cargv[i] + 5 ) );
break;
}
}
"%s: line %d: updatedn line must appear inside a database definition (ignored)\n",
fname, lineno, 0 );
} else {
- be->be_updatedn = strdup( cargv[1] );
+ be->be_updatedn = ch_strdup( cargv[1] );
(void) dn_normalize( be->be_updatedn );
}
exit( 1 );
}
if ( be ) {
- be->be_replogfile = strdup( cargv[1] );
+ be->be_replogfile = ch_strdup( cargv[1] );
} else {
- replogfile = strdup( cargv[1] );
+ replogfile = ch_strdup( cargv[1] );
}
/* maintain lastmodified{by,time} attributes */
fname, lineno, 0 );
exit( 1 );
}
- savefname = strdup( cargv[1] );
+ savefname = ch_strdup( cargv[1] );
savelineno = lineno;
read_config( savefname, bep, NULL );
be = *bep;
fname, lineno, 0 );
exit( 1 );
}
- ldap_srvtab = strdup( cargv[1] );
+ ldap_srvtab = ch_strdup( cargv[1] );
/* pass anything else to the current backend config routine */
} else {
entry_rdwr_init(e);
e->e_attrs = NULL;
- e->e_dn = strdup( SLAPD_CONFIG_DN );
+ e->e_dn = ch_strdup( SLAPD_CONFIG_DN );
for ( i = 0; i < nbackends; i++ ) {
strcpy( buf, backends[i].be_type );
pthread_mutex_lock( &conn->c_dnmutex );
if ( conn->c_dn != NULL ) {
- tmpdn = strdup( conn->c_dn );
+ tmpdn = ch_strdup( conn->c_dn );
} else {
tmpdn = NULL;
}
if ( c[ns].c_addr != NULL ) {
free( c[ns].c_addr );
}
- c[ns].c_addr = strdup( client_addr );
+ c[ns].c_addr = ch_strdup( client_addr );
if ( c[ns].c_domain != NULL ) {
free( c[ns].c_domain );
}
- c[ns].c_domain = strdup( client_name == NULL
+ c[ns].c_domain = ch_strdup( client_name == NULL
? "" : client_name );
pthread_mutex_lock( &c[ns].c_dnmutex );
send_ldap_result( conn, op, LDAP_PROTOCOL_ERROR, NULL, "" );
return;
}
- odn = strdup( dn );
+ odn = ch_strdup( dn );
dn_normalize( dn );
Debug( LDAP_DEBUG_ARGS, "do_delete: dn (%s)\n", dn, 0, 0 );
if ( *(s + 1) == '\0' ) {
return( NULL );
} else {
- return( strdup( s + 1 ) );
+ return( ch_strdup( s + 1 ) );
}
}
if ( *s == '"' )
inquote = 1;
else if ( DNSEPARATOR( *s ) )
- return( strdup( s + 1 ) );
+ return( ch_strdup( s + 1 ) );
}
}
- return( strdup("") );
+ return( ch_strdup("") );
}
/*
e->e_id, e->e_dn, value );
continue;
}
- e->e_dn = strdup( value );
+ e->e_dn = ch_strdup( value );
continue;
}
Debug( LDAP_DEBUG_FILTER, "AND\n", 0, 0, 0 );
if ( (err = get_filter_list( conn, ber, &f->f_and, &ftmp ))
== 0 ) {
- if (ftmp == NULL) ftmp = strdup("");
+ if (ftmp == NULL) ftmp = ch_strdup("");
*fstr = ch_malloc( 4 + strlen( ftmp ) );
sprintf( *fstr, "(&%s)", ftmp );
free( ftmp );
Debug( LDAP_DEBUG_FILTER, "OR\n", 0, 0, 0 );
if ( (err = get_filter_list( conn, ber, &f->f_or, &ftmp ))
== 0 ) {
- if (ftmp == NULL) ftmp = strdup("");
+ if (ftmp == NULL) ftmp = ch_strdup("");
*fstr = ch_malloc( 4 + strlen( ftmp ) );
sprintf( *fstr, "(|%s)", ftmp );
free( ftmp );
Debug( LDAP_DEBUG_FILTER, "NOT\n", 0, 0, 0 );
(void) ber_skip_tag( ber, &len );
if ( (err = get_filter( conn, ber, &f->f_not, &ftmp )) == 0 ) {
- if (ftmp == NULL) ftmp = strdup("");
+ if (ftmp == NULL) ftmp = ch_strdup("");
*fstr = ch_malloc( 4 + strlen( ftmp ) );
sprintf( *fstr, "(!%s)", ftmp );
free( ftmp );
#endif
case 'f': /* read config file */
- configfile = strdup( optarg );
+ configfile = ch_strdup( optarg );
break;
case 'i': /* run from inetd */
Debug( LDAP_DEBUG_TRACE, "%s", Versionstr, 0, 0 );
if ( (myname = strrchr( argv[0], '/' )) == NULL ) {
- myname = strdup( argv[0] );
+ myname = ch_strdup( argv[0] );
} else {
- myname = strdup( myname + 1 );
+ myname = ch_strdup( myname + 1 );
}
if ( ! inetd ) {
inet_ntoa( from.sin_addr ), 0 );
c.c_addr = inet_ntoa( from.sin_addr );
- c.c_domain = strdup( hp == NULL ? "" : hp->h_name );
+ c.c_domain = ch_strdup( hp == NULL ? "" : hp->h_name );
} else {
Debug( LDAP_DEBUG_ARGS, "connection from unknown\n",
0, 0, 0 );
send_ldap_result( conn, op, LDAP_PROTOCOL_ERROR, NULL, "" );
return;
}
- odn = strdup( dn );
+ odn = ch_strdup( dn );
dn_normalize( dn );
Debug( LDAP_DEBUG_ARGS, "do_modify: dn (%s)\n", dn, 0, 0 );
bv.bv_len = strlen( bv.bv_val );
}
tmp = (LDAPMod *) ch_calloc( 1, sizeof(LDAPMod) );
- tmp->mod_type = strdup( "modifiersname" );
+ tmp->mod_type = ch_strdup( "modifiersname" );
tmp->mod_op = LDAP_MOD_REPLACE;
tmp->mod_bvalues = (struct berval **) ch_calloc( 1,
2 * sizeof(struct berval *) );
bv.bv_val = buf;
bv.bv_len = strlen( bv.bv_val );
tmp = (LDAPMod *) ch_calloc( 1, sizeof(LDAPMod) );
- tmp->mod_type = strdup( "modifytimestamp" );
+ tmp->mod_type = ch_strdup( "modifytimestamp" );
tmp->mod_op = LDAP_MOD_REPLACE;
tmp->mod_bvalues = (struct berval **) ch_calloc( 1, 2 * sizeof(struct berval *) );
tmp->mod_bvalues[0] = ber_bvdup( &bv );
send_ldap_result( conn, op, LDAP_PROTOCOL_ERROR, NULL, "" );
return;
}
- odn = strdup( dn );
+ odn = ch_strdup( dn );
dn_normalize( dn );
Debug( LDAP_DEBUG_ARGS,
/* initialize reader/writer lock */
entry_rdwr_init(e);
e->e_attrs = NULL;
- e->e_dn = strdup( SLAPD_MONITOR_DN );
+ e->e_dn = ch_strdup( SLAPD_MONITOR_DN );
val.bv_val = Versionstr;
if (( p = strchr( Versionstr, '\n' )) == NULL ) {
(*tmp)->o_msgid = msgid;
(*tmp)->o_tag = tag;
(*tmp)->o_abandon = 0;
- (*tmp)->o_dn = strdup( dn != NULL ? dn : "" );
+ (*tmp)->o_dn = ch_strdup( dn != NULL ? dn : "" );
pthread_mutex_lock( ¤ttime_mutex );
(*tmp)->o_time = currenttime;
pthread_mutex_unlock( ¤ttime_mutex );
; /* NULL */
save = *s;
*s = '\0';
- ret = strdup( w );
+ ret = ch_strdup( w );
*s = save;
return( ret );
if ( i > 0 )
phoneme[i] = '\0';
- return( strdup( phoneme ) );
+ return( ch_strdup( phoneme ) );
}
#else
Metaph = buf;
*Metaph = '\0';
if (n == ntrans + 4) {
- return( strdup( buf ) ); /* Return if null */
+ return( ch_strdup( buf ) ); /* Return if null */
}
n_end = n; /* Set n_end to end of string */
}
*Metaph = 0; /* Null terminate */
- return( strdup( buf ) );
+ return( ch_strdup( buf ) );
}
#endif /* metaphone */
void * ch_malloc LDAP_P(( unsigned long size ));
void * ch_realloc LDAP_P(( void *block, unsigned long size ));
void * ch_calloc LDAP_P(( unsigned long nelem, unsigned long size ));
+char * ch_strdup LDAP_P(( const char *string ));
/*
* charray.c
return( 1 );
}
- edn = dn_normalize_case( strdup( e->e_dn ) );
+ edn = dn_normalize_case( ch_strdup( e->e_dn ) );
#ifdef LDAP_COMPAT30
if ( (ber = ber_alloc_t( conn->c_version == 30 ? 0 : LBER_USE_DER ))
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 ) {
f->f_choice = LDAP_FILTER_PRESENT;
} else {
f->f_choice = LDAP_FILTER_SUBSTRINGS;
- f->f_sub_type = strdup( str );
+ f->f_sub_type = ch_strdup( str );
if ( str2subvals( value, f ) != 0 ) {
filter_free( f );
*(value-1) = '=';
}
if ( f->f_choice == LDAP_FILTER_PRESENT ) {
- f->f_type = strdup( str );
+ f->f_type = ch_strdup( str );
} else {
- f->f_avtype = strdup( str );
- f->f_avvalue.bv_val = strdup( value );
+ f->f_avtype = ch_strdup( str );
+ f->f_avvalue.bv_val = ch_strdup( value );
f->f_avvalue.bv_len = strlen( value );
}
*nextstar++ = '\0';
if ( gotstar == 0 ) {
- f->f_sub_initial = strdup( val );
+ f->f_sub_initial = ch_strdup( val );
} else if ( nextstar == NULL ) {
- f->f_sub_final = strdup( val );
+ f->f_sub_final = ch_strdup( val );
} else {
- charray_add( &f->f_sub_any, strdup( val ) );
+ charray_add( &f->f_sub_any, ch_strdup( val ) );
}
gotstar = 1;
if (!strcasecmp(be->be_suffixAlias[i],
dn + (dnLength - aliasLength))) {
char *oldDN = dn;
- op->o_suffixAliased = strdup ( be->be_suffixAlias[i] );
+ op->o_suffixAliased = ch_strdup ( be->be_suffixAlias[i] );
dn = ch_malloc ( (dnLength - aliasLength) +
strlen (be->be_suffixAlias[ i+1 ]) + 1);
strncpy (dn, oldDN, dnLength - aliasLength);
strcpy (dn + (dnLength - aliasLength), be->be_suffixAlias[ i+1 ]);
- op->o_suffix = strdup (dn);
+ op->o_suffix = ch_strdup (dn);
Debug( LDAP_DEBUG_ARGS, "ALIAS: converted %s to %s", oldDN, dn, 0);
free (oldDN);
break;