]> git.sur5r.net Git - openldap/commitdiff
Fix: txn is invalidated by mdb_txn_commit()
authorHoward Chu <hyc@openldap.org>
Sat, 21 Jan 2012 16:49:49 +0000 (08:49 -0800)
committerHoward Chu <hyc@openldap.org>
Sat, 21 Jan 2012 16:49:49 +0000 (08:49 -0800)
servers/slapd/back-mdb/add.c

index 6bdc7975ce090e20474430739f62a31d6725f681..4192a3cc79837d180e9f14b1810f146885699cbf 100644 (file)
@@ -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,