--- servers/slapd/overlays/pcache.c 2007/01/02 21:44:08 1.41.2.17 +++ servers/slapd/overlays/pcache.c 2007/06/13 14:28:11 1.41.2.18 @@ -1,4 +1,4 @@ -/* $OpenLDAP: pkg/ldap/servers/slapd/overlays/pcache.c,v 1.41.2.16 2006/02/17 07:38:41 hyc Exp $ */ +/* $OpenLDAP: pkg/ldap/servers/slapd/overlays/pcache.c,v 1.41.2.17 2007/01/02 21:44:08 kurt Exp $ */ /* This work is part of OpenLDAP Software . * * Copyright 2003-2007 The OpenLDAP Foundation. @@ -1026,6 +1026,18 @@ cache_entries( } static int +pcache_op_cleanup( Operation *op, SlapReply *rs ) { + slap_callback *cb = op->o_callback; + struct search_info *si = cb->sc_private; + if ( si->query.save_attrs != NULL ) { + rs->sr_attrs = si->query.save_attrs; + op->ors_attrs = si->query.save_attrs; + } + op->o_callback = op->o_callback->sc_next; + op->o_tmpfree( cb, op->o_tmpmemctx ); +} + +static int pcache_response( Operation *op, SlapReply *rs ) @@ -1097,8 +1109,7 @@ pcache_response( filter_free( si->query.filter ); } - /* free self */ - op->o_callback->sc_cleanup = slap_freeself_cb; + op->o_callback->sc_cleanup = pcache_op_cleanup; } return SLAP_CB_CONTINUE; }