ldap/servers/plugins/dna/dna.c | 2 +-
ldap/servers/plugins/replication/repl5_replica_config.c | 10 +++++++++-
2 files changed, 10 insertions(+), 2 deletions(-)
New commits:
commit 23063fc5844873d44ad2021aaabfbc1472ef981a
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Fri Jun 14 14:43:26 2013 -0400
Coverity (Part 7) + Jenkins fix
11704 - Dereference after null check: repl5_replica_config.c
Jenkins error: dna.c
https://bugzilla.redhat.com/show_bug.cgi?id=970221
Reviewed by: richm(Thanks!)
diff --git a/ldap/servers/plugins/dna/dna.c b/ldap/servers/plugins/dna/dna.c
index a552fb6..ff12dde 100644
--- a/ldap/servers/plugins/dna/dna.c
+++ b/ldap/servers/plugins/dna/dna.c
@@ -1592,7 +1592,7 @@ dna_get_shared_servers(struct configEntry *config_entry, PRCList
**servers)
}
/* see if we defined a server manually */
if(server->remote_bind_method){
- char *reason;
+ char *reason = NULL;
int err = 0;
if(strcasecmp(server->remote_bind_method, DNA_METHOD_DIGESTMD5) ==
0 ||
diff --git a/ldap/servers/plugins/replication/repl5_replica_config.c
b/ldap/servers/plugins/replication/repl5_replica_config.c
index 592faeb..1aa69f0 100644
--- a/ldap/servers/plugins/replication/repl5_replica_config.c
+++ b/ldap/servers/plugins/replication/repl5_replica_config.c
@@ -2484,7 +2484,13 @@ delete_cleaned_rid_config(cleanruv_data *clean_data)
* Search the config for the exact attribute value to delete
*/
pb = slapi_pblock_new();
- dn = replica_get_dn(clean_data->replica);
+ if(clean_data->replica){
+ dn = replica_get_dn(clean_data->replica);
+ } else {
+ rc = -1;
+ goto bail;
+ }
+
slapi_search_internal_set_pb(pb, dn, LDAP_SCOPE_SUBTREE,
"nsds5ReplicaCleanRUV=*", NULL, 0, NULL, NULL,
(void *)plugin_get_default_component_id(), 0);
slapi_search_internal_pb(pb);
@@ -2547,6 +2553,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);