)
{
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);
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 );
}
0, 0, 0 );
entry_free( e );
- free( dn );
send_ldap_result( conn, op, LDAP_OBJECT_CLASS_VIOLATION, "",
"" );
return( -1 );
}
entry_free( e );
- free( dn );
free( pdn );
return -1;
}
cache_return_entry_w( &li->li_cache, p );
entry_free( e );
- free( dn );
return -1;
}
"", "" );
entry_free( e );
- free( dn );
return -1;
}
* 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 );
}
rc = 0;
return_results:;
- if ( dn != NULL )
- free( dn );
-
cache_set_state( &li->li_cache, e, 0 );
if (p != NULL) {
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 );
}