Commit 62cfa792 authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

Fix slapd crash (ITS#38)... onelevel_candidates() should attempt

to return entry lock with e == NULL.
parent fcbb2b0f
...@@ -359,7 +359,7 @@ onelevel_candidates( ...@@ -359,7 +359,7 @@ onelevel_candidates(
) )
{ {
struct ldbminfo *li = (struct ldbminfo *) be->be_private; struct ldbminfo *li = (struct ldbminfo *) be->be_private;
Entry *e; Entry *e = NULL;
Filter *f; Filter *f;
char buf[20]; char buf[20];
IDList *candidates; IDList *candidates;
...@@ -367,7 +367,7 @@ onelevel_candidates( ...@@ -367,7 +367,7 @@ onelevel_candidates(
Debug(LDAP_DEBUG_TRACE, "onelevel_candidates: base: \"%s\"\n", base, 0, 0); Debug(LDAP_DEBUG_TRACE, "onelevel_candidates: base: \"%s\"\n", base, 0, 0);
*err = LDAP_SUCCESS; *err = LDAP_SUCCESS;
e = NULL;
/* get the base object with reader lock */ /* get the base object with reader lock */
if ( base != NULL && *base != '\0' && if ( base != NULL && *base != '\0' &&
(e = dn2entry_r( be, base, matched )) == NULL ) (e = dn2entry_r( be, base, matched )) == NULL )
...@@ -402,7 +402,9 @@ onelevel_candidates( ...@@ -402,7 +402,9 @@ onelevel_candidates(
filter_free( f ); filter_free( f );
/* free entry and reader lock */ /* 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 ); return( candidates );
} }
...@@ -442,6 +444,8 @@ subtree_candidates( ...@@ -442,6 +444,8 @@ subtree_candidates(
*err = LDAP_SUCCESS; *err = LDAP_SUCCESS;
f = NULL; f = NULL;
if ( lookupbase ) { if ( lookupbase ) {
e = NULL;
if ( base != NULL && *base != '\0' && if ( base != NULL && *base != '\0' &&
(e = dn2entry_r( be, base, matched )) == NULL ) (e = dn2entry_r( be, base, matched )) == NULL )
{ {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment