From: Hallvard Furuseth Date: Sun, 27 Dec 1998 04:19:57 +0000 (+0000) Subject: Plug some memory leak X-Git-Tag: OPENLDAP_SLAPD_BACK_LDAP~859 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=d59de0c50f0bcc1530758bcbc5ccf662da43e513;p=openldap Plug some memory leak --- diff --git a/servers/slapd/back-ldbm/search.c b/servers/slapd/back-ldbm/search.c index 99bebd2248..e88af1735f 100644 --- a/servers/slapd/back-ldbm/search.c +++ b/servers/slapd/back-ldbm/search.c @@ -414,7 +414,7 @@ subtree_candidates( ) { 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", @@ -454,7 +454,8 @@ subtree_candidates( /* 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 ) ) { @@ -477,7 +478,7 @@ subtree_candidates( /* free up just the parts we allocated above */ if ( f != NULL ) { - f->f_and->f_next = NULL; + *filterarg_ptr = NULL; filter_free( f ); }