Commit 8cbd5ecc authored by Howard Chu's avatar Howard Chu
Browse files

Cleanup

parent bb9d5b11
......@@ -860,7 +860,7 @@ monitor_back_register_entry_attrs(
done:;
if ( rc ) {
if ( *atp ) {
if ( atp && *atp ) {
attrs_free( *atp );
*atp = NULL;
}
......
......@@ -594,17 +594,9 @@ get_component_reference(
return rc;
}
if ( rc == LDAP_SUCCESS ) {
*cr = ca_comp_ref;
**cr = *ca_comp_ref;
} else if ( op ) {
op->o_tmpfree( ca_comp_ref , op->o_tmpmemctx );
} else {
free( ca_comp_ref ) ;
}
(*cr)->cr_string.bv_val = start;
(*cr)->cr_string.bv_len = end - start + 1;
......
......@@ -1302,9 +1302,6 @@ syncprov_add_slog( Operation *op, struct berval *csn )
sl->sl_mincsn.bv_len = se->se_csn.bv_len;
ch_free( se );
sl->sl_num--;
if ( !sl->sl_head ) {
sl->sl_tail = NULL;
}
}
ldap_pvt_thread_mutex_unlock( &sl->sl_mutex );
}
......
......@@ -422,6 +422,9 @@ slap_sl_free(void *ptr, void *ctx)
unsigned long diff;
int i, inserted = 0;
if (!ptr)
return;
if (!sh || ptr < sh->sh_base || ptr >= sh->sh_end) {
ber_memfree_x(ptr, NULL);
} else if (sh->sh_stack && (char *)ptr + p[-1] == sh->sh_last) {
......
......@@ -75,7 +75,7 @@ value_add(
}
v2 = &(*vals)[n];
for ( ; !BER_BVISNULL( addvals ); v2++, addvals++ ) {
for ( n = 0 ; n < nn; v2++, addvals++ ) {
ber_dupbv( v2, addvals );
if ( BER_BVISNULL( v2 ) ) break;
}
......@@ -718,6 +718,8 @@ ordered_value_add(
next[ 0 ] != '}' ||
next - vals[i].bv_val > vals[i].bv_len )
{
ch_free( nnew );
ch_free( new );
return -1;
}
if ( k > anum ) k = -1;
......
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