]> git.sur5r.net Git - openldap/commitdiff
fix searchFilter double free (ITS#5043)
authorPierangelo Masarati <ando@openldap.org>
Thu, 12 Jul 2007 22:22:31 +0000 (22:22 +0000)
committerPierangelo Masarati <ando@openldap.org>
Thu, 12 Jul 2007 22:22:31 +0000 (22:22 +0000)
servers/slapd/overlays/rwmmap.c

index b88cc4a2af02d65c3ce241a028fd00546bcc2e6e..c1d3cafc95cdf95aee95b9dcd98366f3f02edc5d 100644 (file)
@@ -768,7 +768,9 @@ rwm_filter_map_rewrite(
        case REWRITE_REGEXEC_OK:
                if ( !BER_BVISNULL( fstr ) ) {
                        fstr->bv_len = strlen( fstr->bv_val );
-                       ch_free( ftmp.bv_val );
+                       if ( fstr->bv_val != ftmp.bv_val ) {
+                               ch_free( ftmp.bv_val );
+                       }
 
                } else {
                        *fstr = ftmp;