From: Howard Chu Date: Sat, 20 Oct 2012 16:27:23 +0000 (-0700) Subject: ITS#7402 fix potential txn leak in online indexer X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=c2783b9c5ebf31e55dcac63b877e0884515509cd;p=openldap ITS#7402 fix potential txn leak in online indexer --- diff --git a/servers/slapd/back-bdb/config.c b/servers/slapd/back-bdb/config.c index d12e5d8091..0a680032c0 100644 --- a/servers/slapd/back-bdb/config.c +++ b/servers/slapd/back-bdb/config.c @@ -284,17 +284,16 @@ bdb_online_index( void *ctx, void *arg ) } if ( ei->bei_e ) { rc = bdb_index_entry( op, txn, BDB_INDEX_UPDATE_OP, ei->bei_e ); - if ( rc == DB_LOCK_DEADLOCK ) { + if ( rc ) { TXN_ABORT( txn ); - ldap_pvt_thread_yield(); - continue; - } - if ( rc == 0 ) { - rc = TXN_COMMIT( txn, 0 ); - txn = NULL; - } - if ( rc ) + if ( rc == DB_LOCK_DEADLOCK ) { + ldap_pvt_thread_yield(); + continue; + } break; + } + rc = TXN_COMMIT( txn, 0 ); + txn = NULL; } id++; getnext = 1;