)
{
struct ldbminfo *li = (struct ldbminfo *) be->be_private;
- Filter *f;
+ Filter *f, **filterarg_ptr;
IDList *candidates;
Debug(LDAP_DEBUG_TRACE, "subtree_candidates: base: %s\n",
/* Patch to use normalized uppercase */
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;
+ filterarg_ptr = &f->f_or->f_next;
+ *filterarg_ptr = filter;
filter = f;
if ( ! be_issuffix( be, base ) ) {
/* free up just the parts we allocated above */
if ( f != NULL ) {
- f->f_and->f_next = NULL;
+ *filterarg_ptr = NULL;
filter_free( f );
}