From: Howard Chu Date: Sat, 21 Jan 2012 16:49:49 +0000 (-0800) Subject: Fix: txn is invalidated by mdb_txn_commit() X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=5ca62457f35f5b23f81665b2d606c5f3391bf689;p=openldap Fix: txn is invalidated by mdb_txn_commit() --- 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,