]> git.sur5r.net Git - openldap/commitdiff
Plug some memory leak
authorHallvard Furuseth <hallvard@openldap.org>
Sun, 27 Dec 1998 04:19:57 +0000 (04:19 +0000)
committerHallvard Furuseth <hallvard@openldap.org>
Sun, 27 Dec 1998 04:19:57 +0000 (04:19 +0000)
servers/slapd/back-ldbm/search.c

index 99bebd224817ab11e083c7b7b37317e2c855e611..e88af1735f25aa9f58fadc06b8b98adc82701eff 100644 (file)
@@ -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 );
        }