Plug memleak

This commit is contained in:
Howard Chu 2011-08-26 18:23:54 -07:00
parent bd5c7b74fe
commit 44c291226d
2 changed files with 11 additions and 4 deletions

View file

@ -242,7 +242,8 @@ int mdb_entry_get(
Debug( LDAP_DEBUG_ACL,
"=> mdb_entry_get: cannot find entry: \"%s\"\n",
ndn->bv_val, 0, 0 );
return LDAP_NO_SUCH_OBJECT;
rc = LDAP_NO_SUCH_OBJECT;
goto return_results;
}
Debug( LDAP_DEBUG_ACL,
@ -269,10 +270,16 @@ int mdb_entry_get(
return_results:
if( rc != LDAP_SUCCESS ) {
/* free entry */
mdb_entry_return( e );
if ( e )
mdb_entry_return( e );
if (moi->moi_ref == 1) {
LDAP_SLIST_REMOVE( &op->o_extra, &moi->moi_oe, OpExtra, oe_next );
mdb_txn_reset( txn );
op->o_tmpfree( moi, op->o_tmpmemctx );
}
} else {
*ent = entry_dup( e );
*ent = e;
}
Debug( LDAP_DEBUG_TRACE,

@ -1 +1 @@
Subproject commit e4ff4cdcd26f5c547ccb98caabc97edb43d3d09a
Subproject commit 7a48f12cbbbca1c5781148196e6c621bc776f602