]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/backover.c
Tweaks for OpenSSL 1.1 API deprecations
[openldap] / servers / slapd / backover.c
index b7d22922f450fbfd99324c7da2c95db9d3ef7aad..8914920998c2e5da01f061804a42d8899be77474 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 2003-2015 The OpenLDAP Foundation.
+ * Copyright 2003-2017 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 ) {