mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-01-09 00:14:25 -05:00
Protect return of the locked entry.
Note: we probably can replace the dn2entry_r with dn2id as only the id is needed unless we're holding the lock for filtercandidates or something
This commit is contained in:
parent
818bc57319
commit
8009e591ce
1 changed files with 7 additions and 3 deletions
|
|
@ -358,7 +358,7 @@ onelevel_candidates(
|
|||
)
|
||||
{
|
||||
struct ldbminfo *li = (struct ldbminfo *) be->be_private;
|
||||
Entry *e;
|
||||
Entry *e = NULL;
|
||||
Filter *f;
|
||||
char buf[20];
|
||||
IDList *candidates;
|
||||
|
|
@ -366,7 +366,7 @@ onelevel_candidates(
|
|||
Debug(LDAP_DEBUG_TRACE, "onelevel_candidates: base: \"%s\"\n", base, 0, 0);
|
||||
|
||||
*err = LDAP_SUCCESS;
|
||||
e = NULL;
|
||||
|
||||
/* get the base object with reader lock */
|
||||
if ( base != NULL && *base != '\0' &&
|
||||
(e = dn2entry_r( be, base, matched )) == NULL )
|
||||
|
|
@ -401,7 +401,9 @@ onelevel_candidates(
|
|||
filter_free( f );
|
||||
|
||||
/* free entry and reader lock */
|
||||
cache_return_entry_r( &li->li_cache, e );
|
||||
if( e != NULL ) {
|
||||
cache_return_entry_r( &li->li_cache, e );
|
||||
}
|
||||
return( candidates );
|
||||
}
|
||||
|
||||
|
|
@ -441,6 +443,8 @@ subtree_candidates(
|
|||
*err = LDAP_SUCCESS;
|
||||
f = NULL;
|
||||
if ( lookupbase ) {
|
||||
e = NULL;
|
||||
|
||||
if ( base != NULL && *base != '\0' &&
|
||||
(e = dn2entry_r( be, base, matched )) == NULL )
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue