ldap/servers/plugins/replication/repl5_replica_config.c | 9 +++++++++
1 file changed, 9 insertions(+)
New commits:
commit 05e74ea0982f6218f036cc589f0b4124d6207bfb
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Fri Jun 14 15:28:57 2013 -0400
Coverity Fixes (Part 7)
11704 - Dereference after null check: repl5_replica_config.c
https://bugzilla.redhat.com/show_bug.cgi?id=970221
Reviewed by: richm(Thanks!)
(cherry picked from commit a2cfcf7ff93bf2ef7a3cf4ad2ba2c4e0bd098a3a)
diff --git a/ldap/servers/plugins/replication/repl5_replica_config.c
b/ldap/servers/plugins/replication/repl5_replica_config.c
index b0b3ba5..c770bcb 100644
--- a/ldap/servers/plugins/replication/repl5_replica_config.c
+++ b/ldap/servers/plugins/replication/repl5_replica_config.c
@@ -2380,6 +2380,13 @@ delete_cleaned_rid_config(cleanruv_data *clean_data)
* Search the config for the exact attribute value to delete
*/
pb = slapi_pblock_new();
+ if(clean_data->replica){
+ dn = replica_get_dn(clean_data->replica);
+ } else {
+ rc = -1;
+ goto bail;
+ }
+
dn = replica_get_dn(clean_data->replica);
slapi_search_internal_set_pb(pb, dn, LDAP_SCOPE_SUBTREE,
"nsds5ReplicaCleanRUV=*", NULL, 0, NULL, NULL,
(void *)plugin_get_default_component_id(), 0);
@@ -2443,6 +2450,8 @@ delete_cleaned_rid_config(cleanruv_data *clean_data)
slapi_modify_internal_set_pb(pb, dn, mods, NULL, NULL, repl_get_plugin_identity
(PLUGIN_MULTIMASTER_REPLICATION), 0);
slapi_modify_internal_pb (pb);
slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_RESULT, &rc);
+
+bail:
if (rc != LDAP_SUCCESS && rc != LDAP_NO_SUCH_OBJECT){
slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "CleanAllRUV Task: failed
to remove replica config "
"(%d), rid (%d)\n", rc, clean_data->rid);