X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fstr2filter.c;h=1ab28f146278a4c604cb7f8a247991bf286685d9;hb=dd351c3a17a704edae15ccaa799ee7ea1efe50c4;hp=46b80f5fe678b6393eec854e80cc98674c8518da;hpb=b76c56ba3f45576b9c418ea9fe7f7b3440052904;p=openldap diff --git a/servers/slapd/str2filter.c b/servers/slapd/str2filter.c index 46b80f5fe6..1ab28f1462 100644 --- a/servers/slapd/str2filter.c +++ b/servers/slapd/str2filter.c @@ -3,20 +3,22 @@ #include "portable.h" #include -#include -#include -#include + +#include +#include +#include + #include "slap.h" -static char *find_matching_paren(); -static Filter *str2list(); -static Filter *str2simple(); -static int str2subvals(); +static char *find_matching_paren(char *s); +static Filter *str2list(char *str, long unsigned int ftype); +static Filter *str2simple(char *str); +static int str2subvals(char *val, Filter *f); Filter * str2filter( char *str ) { - Filter *f; + Filter *f = NULL; char *end; Debug( LDAP_DEBUG_FILTER, "str2filter \"%s\"\n", str, 0, 0 ); @@ -165,7 +167,7 @@ str2simple( char *str ) 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) = '='; @@ -178,10 +180,10 @@ str2simple( char *str ) } 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 ); } @@ -204,11 +206,11 @@ str2subvals( char *val, Filter *f ) *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;