]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/overlays/pcache.c
Merge branch 'mdb.master' of ssh://git-master.openldap.org/~git/git/openldap
[openldap] / servers / slapd / overlays / pcache.c
index 4fc84cdaf5db5cce4219be6d3920993a09602b56..d27dcb7a0a7e176279f2e84aef65f980d8aec045 100644 (file)
@@ -1352,14 +1352,16 @@ nextpass:                       eqpass = 1;
                        switch (fs->f_choice) {
                        case LDAP_FILTER_OR:
                        case LDAP_FILTER_AND:
+                               if ( fs->f_next ) {
+                                       /* save our stack position */
+                                       fsp = op->o_tmpalloc(sizeof(fstack), op->o_tmpmemctx);
+                                       fsp->fs_next = stack;
+                                       fsp->fs_fs = fs->f_next;
+                                       fsp->fs_fi = fi->f_next;
+                                       stack = fsp;
+                               }
                                fs = fs->f_and;
                                fi = fi->f_and;
-                               /* save our stack position */
-                               fsp = op->o_tmpalloc(sizeof(fstack), op->o_tmpmemctx);
-                               fsp->fs_next = stack;
-                               fsp->fs_fs = fs->f_next;
-                               fsp->fs_fi = fi->f_next;
-                               stack = fsp;
                                res=1;
                                break;
                        case LDAP_FILTER_SUBSTRINGS:
@@ -1408,6 +1410,7 @@ nextpass:                 eqpass = 1;
                                break;
                        }
                        if (!fs && !fi && stack) {
+                               /* pop the stack */
                                fsp = stack;
                                stack = fsp->fs_next;
                                fs = fsp->fs_fs;
@@ -2905,9 +2908,9 @@ pcache_op_bind(
 
        /* OK, just bind locally */
        if ( bi.bi_flags & BI_HASHED ) {
+               int delete = 0;
                BackendDB *be = op->o_bd;
                op->o_bd = &cm->db;
-               int delete = 0;
 
                Debug( pcache_debug, "pcache_op_bind: CACHED BIND for %s\n",
                        op->o_req_dn.bv_val, 0, 0 );