]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-sql/operational.c
use pooled memory whenever appropriate
[openldap] / servers / slapd / back-sql / operational.c
index 2fc2ac0855b40fa6c20cb4cd75973214e1b883ed..e99741a6d9b4ae530e504a5f971f32c889f661cf 100644 (file)
@@ -83,7 +83,7 @@ backsql_operational_entryCSN( Operation *op )
        BER_BVZERO( &a->a_vals[ 1 ] );
 
 #ifdef BACKSQL_SYNCPROV
-       if ( op->o_sync && op->o_tag == LDAP_REQ_SEARCH ) {
+       if ( op->o_sync && op->o_tag == LDAP_REQ_SEARCH && op->o_private != NULL ) {
                assert( op->o_private != NULL );
 
                entryCSN = *((struct berval *)op->o_private);
@@ -91,7 +91,9 @@ backsql_operational_entryCSN( Operation *op )
        } else
 #endif /* BACKSQL_SYNCPROV */
        {
-               slap_get_csn( op, csnbuf, sizeof(csnbuf), &entryCSN, 0 );
+               entryCSN.bv_val = csnbuf;
+               entryCSN.bv_len = sizeof( csnbuf );
+               slap_get_csn( op, &entryCSN, 0 );
        }
 
        ber_dupbv( &a->a_vals[ 0 ], &entryCSN );
@@ -184,7 +186,6 @@ backsql_operational(
 
                rc = backsql_init_search( &bsi, &rs->sr_entry->e_nname,
                                LDAP_SCOPE_BASE,
-                               SLAP_NO_LIMIT, SLAP_NO_LIMIT,
                                (time_t)(-1), NULL, dbh, op, rs, NULL,
                                BACKSQL_ISF_GET_ID );
                if ( rc != LDAP_SUCCESS ) {