ldap/servers/plugins/replication/cl5_api.c | 1 -
ldap/servers/plugins/replication/repl5_replica_config.c | 14 ++++++--------
2 files changed, 6 insertions(+), 9 deletions(-)
New commits:
commit d4d10723bcea672739fe3407390caac392d1acfe
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Wed Jan 4 09:41:38 2017 -0500
Ticket 48964 - should not free repl name after purging changelog
Bug Description: The previous commit for this ticket incorrectly
freed a replica struct const char. There was also
a minor converity issue.
Fix Description: Do not free the repl_name after purging, and do
not check if "replica" is NULL when creating the
purge data.
https://fedorahosted.org/389/ticket/48964
Reviewed by: tbordaz(Thanks!)
(cherry picked from commit 017469a1a055da03fc3fb4b34a7732611b7bd2b0)
diff --git a/ldap/servers/plugins/replication/cl5_api.c
b/ldap/servers/plugins/replication/cl5_api.c
index 3c46ed3..9b2ef37 100644
--- a/ldap/servers/plugins/replication/cl5_api.c
+++ b/ldap/servers/plugins/replication/cl5_api.c
@@ -6888,7 +6888,6 @@ cl5CleanRUV(ReplicaId rid){
static void free_purge_data(cleanruv_purge_data *purge_data)
{
slapi_ch_free_string(&purge_data->replGen);
- slapi_ch_free_string(&purge_data->replName);
slapi_ch_free((void **)&purge_data);
}
diff --git a/ldap/servers/plugins/replication/repl5_replica_config.c
b/ldap/servers/plugins/replication/repl5_replica_config.c
index c6a9ffa..bd20b8a 100644
--- a/ldap/servers/plugins/replication/repl5_replica_config.c
+++ b/ldap/servers/plugins/replication/repl5_replica_config.c
@@ -1245,14 +1245,12 @@ replica_execute_cleanruv_task (Object *r, ReplicaId rid, char
*returntext /* not
/*
* Now purge the changelog. The purging thread will free the purge_data
*/
- if (replica){
- purge_data = (cleanruv_purge_data*)slapi_ch_calloc(1, sizeof(cleanruv_purge_data));
- purge_data->cleaned_rid = rid;
- purge_data->suffix_sdn = replica_get_root(replica);
- purge_data->replName = (char *)replica_get_name(replica);
- purge_data->replGen = replica_get_generation(replica);
- trigger_cl_purging(purge_data);
- }
+ purge_data = (cleanruv_purge_data*)slapi_ch_calloc(1, sizeof(cleanruv_purge_data));
+ purge_data->cleaned_rid = rid;
+ purge_data->suffix_sdn = replica_get_root(replica);
+ purge_data->replName = (char *)replica_get_name(replica);
+ purge_data->replGen = replica_get_generation(replica);
+ trigger_cl_purging(purge_data);
if (rc != RUV_SUCCESS){
slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "cleanruv_task: task
failed(%d)\n",rc);