X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fbackover.c;h=2448b9489ac7c4ccad5893dbb141c8debb257a66;hb=23c5d6bbdd01d91556eab16b43fbc607d44feb7c;hp=918dd1701cb7838604a14db5468263644bf20198;hpb=bae699bfd925327f424d4fddd852356a9b51bc8e;p=openldap diff --git a/servers/slapd/backover.c b/servers/slapd/backover.c index 918dd1701c..2448b9489a 100644 --- a/servers/slapd/backover.c +++ b/servers/slapd/backover.c @@ -2,7 +2,7 @@ /* $OpenLDAP$ */ /* This work is part of OpenLDAP Software . * - * Copyright 2003-2014 The OpenLDAP Foundation. + * Copyright 2003-2016 The OpenLDAP Foundation. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -727,7 +727,8 @@ over_op_func( slap_overinfo *oi; slap_overinst *on; BackendDB *be = op->o_bd, db; - slap_callback cb = {NULL, over_back_response, NULL, NULL}, **sc; + slap_callback **sc; + slap_callback *cb = (slap_callback *) ch_malloc( sizeof( slap_callback )); int rc = SLAP_CB_CONTINUE; /* FIXME: used to happen for instance during abandon @@ -742,14 +743,18 @@ over_op_func( db.be_flags |= SLAP_DBFLAG_OVERLAY; op->o_bd = &db; } - cb.sc_next = op->o_callback; - cb.sc_private = oi; - op->o_callback = &cb; + cb->sc_cleanup = NULL; + cb->sc_response = over_back_response; + cb->sc_writewait = NULL; + cb->sc_next = op->o_callback; + cb->sc_private = oi; + op->o_callback = cb; rc = overlay_op_walk( op, rs, which, oi, on ); for ( sc = &op->o_callback; *sc; sc = &(*sc)->sc_next ) { - if ( *sc == &cb ) { - *sc = cb.sc_next; + if ( *sc == cb ) { + *sc = cb->sc_next; + ch_free( cb ); break; } } @@ -1240,6 +1245,7 @@ overlay_remove( BackendDB *be, slap_overinst *on, Operation *op ) rm_cb->sc_cleanup = overlay_remove_cb; rm_cb->sc_response = NULL; rm_cb->sc_private = (void*) rm_ctx; + rm_cb->sc_writewait = NULL; /* Append callback to the end of the list */ if ( !op->o_callback ) {