Skip to content
Snippets Groups Projects
Commit 77b2e2cb authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

Use Entry's e_ndn instead of recomputing it.

parent e5f8117f
No related branches found
No related tags found
No related merge requests found
......@@ -20,12 +20,12 @@ ldbm_back_add(
)
{
struct ldbminfo *li = (struct ldbminfo *) be->be_private;
char *dn = NULL, *pdn;
char *dn, *pdn;
Entry *p = NULL;
int rootlock = 0;
int rc = -1;
dn = dn_normalize( ch_strdup( e->e_dn ) );
dn = e->e_ndn;
Debug(LDAP_DEBUG_ARGS, "==> ldbm_back_add: %s\n", dn, 0, 0);
......@@ -35,7 +35,6 @@ ldbm_back_add(
if ( ( dn2id( be, dn ) ) != NOID ) {
pthread_mutex_unlock(&li->li_add_mutex);
entry_free( e );
free( dn );
send_ldap_result( conn, op, LDAP_ALREADY_EXISTS, "", "" );
return( -1 );
}
......@@ -47,7 +46,6 @@ ldbm_back_add(
0, 0, 0 );
entry_free( e );
free( dn );
send_ldap_result( conn, op, LDAP_OBJECT_CLASS_VIOLATION, "",
"" );
return( -1 );
......@@ -75,7 +73,6 @@ ldbm_back_add(
}
entry_free( e );
free( dn );
free( pdn );
return -1;
}
......@@ -101,7 +98,6 @@ ldbm_back_add(
cache_return_entry_w( &li->li_cache, p );
entry_free( e );
free( dn );
return -1;
}
......@@ -115,7 +111,6 @@ ldbm_back_add(
"", "" );
entry_free( e );
free( dn );
return -1;
}
......@@ -152,7 +147,6 @@ ldbm_back_add(
* because e hasn't been added to the cache yet
*/
entry_free( e );
free( dn );
send_ldap_result( conn, op, LDAP_ALREADY_EXISTS, "", "" );
return( -1 );
}
......@@ -209,9 +203,6 @@ ldbm_back_add(
rc = 0;
return_results:;
if ( dn != NULL )
free( dn );
cache_set_state( &li->li_cache, e, 0 );
if (p != NULL) {
......
......@@ -217,13 +217,12 @@ ldbm_back_search(
if ( (dn = dn_parent( be, e->e_dn )) != NULL ) {
(void) dn_normalize( dn );
scopeok = (dn == realBase) ? 1 : (! strcasecmp( dn, realBase ));
free( dn );
} else {
scopeok = (realBase == NULL || *realBase == '\0');
}
free( dn );
} else if ( scope == LDAP_SCOPE_SUBTREE ) {
dn = ch_strdup( e->e_dn );
(void) dn_normalize( dn );
dn = ch_strdup( e->e_ndn );
scopeok = dn_issuffix( dn, realBase );
free( dn );
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment