--- servers/slapd/filter.c 2003/02/09 16:31:36 1.72.2.9 +++ servers/slapd/filter.c 2003/03/12 20:58:48 1.72.2.10 @@ -1,5 +1,5 @@ /* filter.c - routines for parsing and dealing with filters */ -/* $OpenLDAP: pkg/ldap/servers/slapd/filter.c,v 1.89 2003/01/20 19:21:17 kurt Exp $ */ +/* $OpenLDAP: pkg/ldap/servers/slapd/filter.c,v 1.72.2.9 2003/02/09 16:31:36 kurt Exp $ */ /* * Copyright 1998-2003 The OpenLDAP Foundation, All Rights Reserved. * COPYING RESTRICTIONS APPLY, see COPYRIGHT file @@ -602,7 +602,7 @@ filter2bv( Filter *f, struct berval *fst fstr->bv_len = f->f_av_desc->ad_cname.bv_len + tmp.bv_len + ( sizeof("(=)") - 1 ); - fstr->bv_val = malloc( fstr->bv_len + 1 ); + fstr->bv_val = ch_malloc( fstr->bv_len + 1 ); snprintf( fstr->bv_val, fstr->bv_len + 1, "(%s=%s)", f->f_av_desc->ad_cname.bv_val, @@ -616,7 +616,7 @@ filter2bv( Filter *f, struct berval *fst fstr->bv_len = f->f_av_desc->ad_cname.bv_len + tmp.bv_len + ( sizeof("(>=)") - 1 ); - fstr->bv_val = malloc( fstr->bv_len + 1 ); + fstr->bv_val = ch_malloc( fstr->bv_len + 1 ); snprintf( fstr->bv_val, fstr->bv_len + 1, "(%s>=%s)", f->f_av_desc->ad_cname.bv_val, @@ -630,7 +630,7 @@ filter2bv( Filter *f, struct berval *fst fstr->bv_len = f->f_av_desc->ad_cname.bv_len + tmp.bv_len + ( sizeof("(<=)") - 1 ); - fstr->bv_val = malloc( fstr->bv_len + 1 ); + fstr->bv_val = ch_malloc( fstr->bv_len + 1 ); snprintf( fstr->bv_val, fstr->bv_len + 1, "(%s<=%s)", f->f_av_desc->ad_cname.bv_val, @@ -644,7 +644,7 @@ filter2bv( Filter *f, struct berval *fst fstr->bv_len = f->f_av_desc->ad_cname.bv_len + tmp.bv_len + ( sizeof("(~=)") - 1 ); - fstr->bv_val = malloc( fstr->bv_len + 1 ); + fstr->bv_val = ch_malloc( fstr->bv_len + 1 ); snprintf( fstr->bv_val, fstr->bv_len + 1, "(%s~=%s)", f->f_av_desc->ad_cname.bv_val, @@ -655,7 +655,7 @@ filter2bv( Filter *f, struct berval *fst case LDAP_FILTER_SUBSTRINGS: fstr->bv_len = f->f_sub_desc->ad_cname.bv_len + ( sizeof("(=*)") - 1 ); - fstr->bv_val = malloc( fstr->bv_len + 128 ); + fstr->bv_val = ch_malloc( fstr->bv_len + 128 ); snprintf( fstr->bv_val, fstr->bv_len + 1, "(%s=*)", f->f_sub_desc->ad_cname.bv_val ); @@ -710,7 +710,7 @@ filter2bv( Filter *f, struct berval *fst case LDAP_FILTER_PRESENT: fstr->bv_len = f->f_desc->ad_cname.bv_len + ( sizeof("(=*)") - 1 ); - fstr->bv_val = malloc( fstr->bv_len + 1 ); + fstr->bv_val = ch_malloc( fstr->bv_len + 1 ); snprintf( fstr->bv_val, fstr->bv_len + 1, "(%s=*)", f->f_desc->ad_cname.bv_val ); @@ -720,7 +720,7 @@ filter2bv( Filter *f, struct berval *fst case LDAP_FILTER_OR: case LDAP_FILTER_NOT: fstr->bv_len = sizeof("(%)") - 1; - fstr->bv_val = malloc( fstr->bv_len + 128 ); + fstr->bv_val = ch_malloc( fstr->bv_len + 128 ); snprintf( fstr->bv_val, fstr->bv_len + 1, "(%c)", f->f_choice == LDAP_FILTER_AND ? '&' : @@ -757,7 +757,7 @@ filter2bv( Filter *f, struct berval *fst ( f->f_mr_dnattrs ? sizeof(":dn")-1 : 0 ) + ( f->f_mr_rule_text.bv_len ? f->f_mr_rule_text.bv_len+1 : 0 ) + tmp.bv_len + ( sizeof("(:=)") - 1 ); - fstr->bv_val = malloc( fstr->bv_len + 1 ); + fstr->bv_val = ch_malloc( fstr->bv_len + 1 ); snprintf( fstr->bv_val, fstr->bv_len + 1, "(%s%s%s%s:=%s)", ad.bv_val, @@ -1141,7 +1141,7 @@ vrFilter2bv( ValuesReturnFilter *vrf, st } fstr->bv_len = sizeof("()") - 1; - fstr->bv_val = malloc( fstr->bv_len + 128 ); + fstr->bv_val = ch_malloc( fstr->bv_len + 128 ); snprintf( fstr->bv_val, fstr->bv_len + 1, "()"); @@ -1177,7 +1177,7 @@ simple_vrFilter2bv( ValuesReturnFilter * fstr->bv_len = vrf->vrf_av_desc->ad_cname.bv_len + tmp.bv_len + ( sizeof("(=)") - 1 ); - fstr->bv_val = malloc( fstr->bv_len + 1 ); + fstr->bv_val = ch_malloc( fstr->bv_len + 1 ); snprintf( fstr->bv_val, fstr->bv_len + 1, "(%s=%s)", vrf->vrf_av_desc->ad_cname.bv_val, @@ -1191,7 +1191,7 @@ simple_vrFilter2bv( ValuesReturnFilter * fstr->bv_len = vrf->vrf_av_desc->ad_cname.bv_len + tmp.bv_len + ( sizeof("(>=)") - 1 ); - fstr->bv_val = malloc( fstr->bv_len + 1 ); + fstr->bv_val = ch_malloc( fstr->bv_len + 1 ); snprintf( fstr->bv_val, fstr->bv_len + 1, "(%s>=%s)", vrf->vrf_av_desc->ad_cname.bv_val, @@ -1205,7 +1205,7 @@ simple_vrFilter2bv( ValuesReturnFilter * fstr->bv_len = vrf->vrf_av_desc->ad_cname.bv_len + tmp.bv_len + ( sizeof("(<=)") - 1 ); - fstr->bv_val = malloc( fstr->bv_len + 1 ); + fstr->bv_val = ch_malloc( fstr->bv_len + 1 ); snprintf( fstr->bv_val, fstr->bv_len + 1, "(%s<=%s)", vrf->vrf_av_desc->ad_cname.bv_val, @@ -1219,7 +1219,7 @@ simple_vrFilter2bv( ValuesReturnFilter * fstr->bv_len = vrf->vrf_av_desc->ad_cname.bv_len + tmp.bv_len + ( sizeof("(~=)") - 1 ); - fstr->bv_val = malloc( fstr->bv_len + 1 ); + fstr->bv_val = ch_malloc( fstr->bv_len + 1 ); snprintf( fstr->bv_val, fstr->bv_len + 1, "(%s~=%s)", vrf->vrf_av_desc->ad_cname.bv_val, @@ -1230,7 +1230,7 @@ simple_vrFilter2bv( ValuesReturnFilter * case LDAP_FILTER_SUBSTRINGS: fstr->bv_len = vrf->vrf_sub_desc->ad_cname.bv_len + ( sizeof("(=*)") - 1 ); - fstr->bv_val = malloc( fstr->bv_len + 128 ); + fstr->bv_val = ch_malloc( fstr->bv_len + 128 ); snprintf( fstr->bv_val, fstr->bv_len + 1, "(%s=*)", vrf->vrf_sub_desc->ad_cname.bv_val ); @@ -1286,7 +1286,7 @@ simple_vrFilter2bv( ValuesReturnFilter * case LDAP_FILTER_PRESENT: fstr->bv_len = vrf->vrf_desc->ad_cname.bv_len + ( sizeof("(=*)") - 1 ); - fstr->bv_val = malloc( fstr->bv_len + 1 ); + fstr->bv_val = ch_malloc( fstr->bv_len + 1 ); snprintf( fstr->bv_val, fstr->bv_len + 1, "(%s=*)", vrf->vrf_desc->ad_cname.bv_val ); @@ -1307,7 +1307,7 @@ simple_vrFilter2bv( ValuesReturnFilter * ( vrf->vrf_mr_dnattrs ? sizeof(":dn")-1 : 0 ) + ( vrf->vrf_mr_rule_text.bv_len ? vrf->vrf_mr_rule_text.bv_len+1 : 0 ) + tmp.bv_len + ( sizeof("(:=)") - 1 ); - fstr->bv_val = malloc( fstr->bv_len + 1 ); + fstr->bv_val = ch_malloc( fstr->bv_len + 1 ); snprintf( fstr->bv_val, fstr->bv_len + 1, "(%s%s%s%s:=%s)", ad.bv_val,