summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
Diffstat (limited to 'source4')
-rw-r--r--source4/ldap_server/ldap_backend.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source4/ldap_server/ldap_backend.c b/source4/ldap_server/ldap_backend.c
index d983a54261..689fd31141 100644
--- a/source4/ldap_server/ldap_backend.c
+++ b/source4/ldap_server/ldap_backend.c
@@ -206,9 +206,11 @@ static int ldb_mod_req_with_controls(struct ldb_context *ldb,
}
if (ret == LDB_SUCCESS) {
- return ldb_transaction_commit(ldb);
+ ret = ldb_transaction_commit(ldb);
+ }
+ else {
+ ldb_transaction_cancel(ldb);
}
- ldb_transaction_cancel(ldb);
talloc_free(req);
return ret;