]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
More for ITS#4638, double-free fix from HEAD OPENLDAP_REL_ENG_2_3_32
authorHoward Chu <hyc@openldap.org>
Thu, 4 Jan 2007 06:07:20 +0000 (06:07 +0000)
committerHoward Chu <hyc@openldap.org>
Thu, 4 Jan 2007 06:07:20 +0000 (06:07 +0000)
servers/slapd/back-ldap/search.c

index abd1019db50017236d7351ac406fb8fd972f86cd..a7645bd9265ca29b80eb2ed1b4b83092ca391627 100644 (file)
@@ -150,6 +150,7 @@ ldap_back_search(
                        msgid; 
        struct berval   match = BER_BVNULL,
                        filter = BER_BVNULL;
+       int             free_filter = 0;
        int             i;
        char            **attrs = NULL;
        int             freetext = 0;
@@ -237,6 +238,7 @@ retry:
 
                case LDAP_FILTER_ERROR:
                        if ( ldap_back_munge_filter( op, &filter ) ) {
+                               free_filter = 1;
                                goto retry;
                        }
 
@@ -495,7 +497,7 @@ finish:;
                rs->sr_matched = save_matched;
        }
 
-       if ( !BER_BVISNULL( &filter ) && filter.bv_val != op->ors_filterstr.bv_val ) {
+       if ( free_filter ) {
                op->o_tmpfree( filter.bv_val, op->o_tmpmemctx );
        }