]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/compare.c
ITS#8789 avoid unnecessary writes of context entry
[openldap] / servers / slapd / compare.c
index 931cbdb3712ccf738565fe7e9816f5afb4afd9aa..b36062d3958d7eda5af8be7bd06ffa1f8e7f5195 100644 (file)
@@ -1,7 +1,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2014 The OpenLDAP Foundation.
+ * Copyright 1998-2017 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -125,6 +125,10 @@ do_compare(
 
        op->o_bd = frontendDB;
        rs->sr_err = frontendDB->be_compare( op, rs );
+       if ( rs->sr_err == SLAPD_ASYNCOP ) {
+               /* skip cleanup */
+               return rs->sr_err;
+       }
 
 cleanup:;
        op->o_tmpfree( op->o_req_dn.bv_val, op->o_tmpmemctx );