ldb: Reset error string before running prepare_commit() hook
authorAndrew Bartlett <abartlet@samba.org>
Tue, 29 May 2018 04:14:45 +0000 (16:14 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 30 May 2018 02:23:26 +0000 (04:23 +0200)
This ensures that the error string returned to the caller reflects a failure in this call.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
lib/ldb/common/ldb.c

index 2249089..5525e70 100644 (file)
@@ -425,6 +425,8 @@ int ldb_transaction_prepare_commit(struct ldb_context *ldb)
                return LDB_SUCCESS;
        }
 
+       ldb_reset_err_string(ldb);
+
        status = next_module->ops->prepare_commit(next_module);
        if (status != LDB_SUCCESS) {
                ldb->transaction_active--;