]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-ldbm/compare.c
Initial step of index files fix, more tomorrow.
[openldap] / servers / slapd / back-ldbm / compare.c
index d17c5da88a9dca191f51405c1b9156816b0842d0..fc6e17144419ad430ae5ac6ac9e3b9f5e31e4d36 100644 (file)
@@ -29,12 +29,15 @@ ldbm_back_compare(
        /* get entry with reader lock */
        if ( (e = dn2entry_r( be, dn, &matched )) == NULL ) {
                send_ldap_result( conn, op, LDAP_NO_SUCH_OBJECT, matched, "" );
+
+               if(matched == NULL) free(matched);
                return( 1 );
        }
 
        /* check for deleted */
-       if ( ! access_allowed( be, conn, op, e, ava->ava_type, &ava->ava_value,
-           op->o_dn, ACL_COMPARE ) ) {
+       if ( ! access_allowed( be, conn, op, e,
+               ava->ava_type, &ava->ava_value, ACL_COMPARE ) )
+       {
                send_ldap_result( conn, op, LDAP_INSUFFICIENT_ACCESS, "", "" );
                rc = 1;
                goto return_results;