From d59de0c50f0bcc1530758bcbc5ccf662da43e513 Mon Sep 17 00:00:00 2001 From: Hallvard Furuseth Date: Sun, 27 Dec 1998 04:19:57 +0000 Subject: [PATCH] Plug some memory leak --- servers/slapd/back-ldbm/search.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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 ); } -- 2.39.5