]> git.sur5r.net Git - openldap/commitdiff
ITS#8351 fix accesslog callback init
authorHoward Chu <hyc@openldap.org>
Fri, 15 Jan 2016 10:37:56 +0000 (10:37 +0000)
committerQuanah Gibson-Mount <quanah@openldap.org>
Tue, 19 Jan 2016 00:22:37 +0000 (18:22 -0600)
servers/slapd/overlays/accesslog.c

index cc6112cdd60cef496365de5723c0b3dcdf006569..1781669031333412a28af51f7bfbf6dffe27e9e5 100644 (file)
@@ -578,7 +578,7 @@ log_age_unparse( int age, struct berval *agebv, size_t size )
        agebv->bv_len = ptr - agebv->bv_val;
 }
 
-static slap_callback nullsc = { NULL, NULL, NULL, NULL };
+static slap_callback nullsc;
 
 #define PURGE_INCREMENT        100
 
@@ -637,7 +637,7 @@ accesslog_purge( void *ctx, void *arg )
        OperationBuffer opbuf;
        Operation *op;
        SlapReply rs = {REP_RESULT};
-       slap_callback cb = { NULL, log_old_lookup, NULL, NULL };
+       slap_callback cb = { NULL, log_old_lookup, NULL, NULL, NULL };
        Filter f;
        AttributeAssertion ava = ATTRIBUTEASSERTION_INIT;
        purge_data pd = {0};
@@ -1975,11 +1975,9 @@ accesslog_op_mod( Operation *op, SlapReply *rs )
        }
                        
        if ( doit ) {
-               slap_callback *cb = op->o_tmpalloc( sizeof( slap_callback ), op->o_tmpmemctx ), *cb2;
+               slap_callback *cb = op->o_tmpcalloc( 1, sizeof( slap_callback ), op->o_tmpmemctx ), *cb2;
                cb->sc_cleanup = accesslog_mod_cleanup;
-               cb->sc_response = NULL;
                cb->sc_private = on;
-               cb->sc_next = NULL;
                for ( cb2 = op->o_callback; cb2->sc_next; cb2 = cb2->sc_next );
                cb2->sc_next = cb;