]> git.sur5r.net Git - openldap/commitdiff
make sure callback is freed (ITS#6640)
authorPierangelo Masarati <ando@openldap.org>
Tue, 7 Sep 2010 02:01:35 +0000 (02:01 +0000)
committerPierangelo Masarati <ando@openldap.org>
Tue, 7 Sep 2010 02:01:35 +0000 (02:01 +0000)
servers/slapd/overlays/pcache.c

index 46ce69ce695195a4f48b89b2be637c6bae38074b..88b90c3a32ece82d6bbbeda632cf83f1d1bad343 100644 (file)
@@ -2389,8 +2389,7 @@ over:;
                                        entry_free(si->head);
                                }
                        }
-                       op->o_callback = op->o_callback->sc_next;
-                       op->o_tmpfree( cb, op->o_tmpmemctx );
+
                } else if ( si->caching_reason != PC_IGNORE ) {
                        CachedQuery *qc = qm->addfunc(op, qm, &si->query,
                                si->qtemp, si->caching_reason, 1 );
@@ -2446,6 +2445,9 @@ over:;
                } else {
                        filter_free( si->query.filter );
                }
+
+               op->o_callback = op->o_callback->sc_next;
+               op->o_tmpfree( cb, op->o_tmpmemctx );
        }
 
        return SLAP_CB_CONTINUE;