if ( syncCookie.bv_len ) {
syncrepl_updateCookie( si, ld, &op, &psub, &syncCookie );
}
- if ( rc_efree )
+ if ( modlist ) {
+ slap_mods_free( modlist );
+ }
+ if ( rc_efree ) {
entry_free( entry );
- for ( ml = modlist; ml != NULL; ml = mlnext ) {
- mlnext = ml->sml_next;
- ber_memfree( ml );
}
break;
break;
}
+ if ( syncCookie.bv_val )
+ ch_free( syncCookie.bv_val );
+ if ( syncUUID.bv_val )
+ ch_free( syncUUID.bv_val );
}
ldap_msgfree( res );
}
ber_scanf( ctrl_ber, "o}", syncCookie );
}
ber_free( ctrl_ber, 1 );
+ ldap_controls_free( rctrls );
} else {
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, ERR,"syncrepl_message_to_entry : "
#endif
}
- if ( *syncstate == LDAP_SYNC_PRESENT ) {
- e = NULL;
- goto done;
- } else if ( *syncstate == LDAP_SYNC_DELETE ) {
+ if ( *syncstate == LDAP_SYNC_PRESENT || *syncstate == LDAP_SYNC_DELETE ) {
goto done;
}
}
if ( syncstate == LDAP_SYNC_PRESENT ) {
- if ( e )
+ if ( e ) {
return 1;
- else
+ } else {
return 0;
+ }
}
filterstr = (char *) sl_malloc( strlen("entryUUID=") + syncUUID->bv_len + 1,
strcat( filterstr, syncUUID->bv_val );
si->e = e;
- si->syncUUID = syncUUID;
si->syncUUID_ndn = NULL;
filter = str2filter( filterstr );
"syncrepl_entry : be_modify failed (%d)\n",
rc, 0, 0 );
#endif
- return 1;
}
- return 0;
+ return 1;
} else if ( rc == LDAP_REFERRAL ||
rc == LDAP_NO_SUCH_OBJECT ) {
syncrepl_add_glue( si, ld, op, e,
Modifications *ml;
Modifications *mlnext;
Modifications *mod;
- Modifications *modlist;
+ Modifications *modlist = NULL;
Modifications **modtail = &modlist;
struct berval* ocbva = NULL;
char txtbuf[SLAP_TEXT_BUFLEN];
size_t textlen = sizeof txtbuf;
- Entry* e;
+ Entry* e = NULL;
int rc;
struct berval sub_bv = { 0, NULL };
}
}
- if ( e != NULL )
- entry_free( e );
-
done :
- for ( ml = modlist; ml != NULL; ml = mlnext ) {
- mlnext = ml->sml_next;
- free( ml );
+ if ( e != NULL ) {
+ entry_free( e );
+ }
+
+ if ( modlist ) {
+ slap_mods_free( modlist );
}
return;
return;
}
if ( ((struct berval *)bv)->bv_val != NULL ) {
- ber_memfree ( ((struct berval *)bv)->bv_val );
+ ch_free ( ((struct berval *)bv)->bv_val );
}
- ber_memfree ( (char *) bv );
+ ch_free ( (char *) bv );
}
static int
} else {
avl_delete( &si->presentlist,
&a->a_vals[0], syncuuid_cmp );
+ ch_free( present_uuid->bv_val );
+ ch_free( present_uuid );
}
return LDAP_SUCCESS;
} else {