From 5ca62457f35f5b23f81665b2d606c5f3391bf689 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Sat, 21 Jan 2012 08:49:49 -0800 Subject: [PATCH] Fix: txn is invalidated by mdb_txn_commit() --- servers/slapd/back-mdb/add.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/servers/slapd/back-mdb/add.c b/servers/slapd/back-mdb/add.c index 6bdc7975ce..4192a3cc79 100644 --- a/servers/slapd/back-mdb/add.c +++ b/servers/slapd/back-mdb/add.c @@ -408,7 +408,9 @@ txnReturn: goto return_results; } - if (( rs->sr_err = mdb_txn_commit( txn )) != 0 ) { + rs->sr_err = mdb_txn_commit( txn ); + txn = NULL; + if ( rs->sr_err != 0 ) { rs->sr_text = "txn_commit failed"; Debug( LDAP_DEBUG_TRACE, LDAP_XSTRING(mdb_add) ": %s : %s (%d)\n", @@ -416,7 +418,6 @@ txnReturn: rs->sr_err = LDAP_OTHER; goto return_results; } - txn = NULL; } Debug(LDAP_DEBUG_TRACE, -- 2.39.5