summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNoriko Hosoi <nhosoi@redhat.com>2010-07-02 13:35:53 -0700
committerNoriko Hosoi <nhosoi@redhat.com>2010-07-23 13:24:45 -0700
commit8672c1fddb51e72329618ae07c2af1cf1b577176 (patch)
treed97ca59dbf91a87b64f607c774e69ae3dc18ead6
parent40cbfa6cc5f5781cfe4a3bd41f6acd648bf1e23e (diff)
downloadds-8672c1fddb51e72329618ae07c2af1cf1b577176.tar.gz
ds-8672c1fddb51e72329618ae07c2af1cf1b577176.tar.xz
ds-8672c1fddb51e72329618ae07c2af1cf1b577176.zip
610281 - fix coverity Defect Type: Control flow issues
https://bugzilla.redhat.com/show_bug.cgi?id=610281 11803 DEADCODE Triaged Unassigned Bug Minor Fix Required _cl5GetFirstEntry() ds/ldap/servers/plugins/replication/cl5_api.c 11804 DEADCODE Triaged Unassigned Bug Minor Fix Required _cl5GetNextEntry() ds/ldap/servers/plugins/replication/cl5_api.c Comment: Eliminated unnecessary codes.
-rw-r--r--ldap/servers/plugins/replication/cl5_api.c33
1 files changed, 9 insertions, 24 deletions
diff --git a/ldap/servers/plugins/replication/cl5_api.c b/ldap/servers/plugins/replication/cl5_api.c
index f61bd0aa..6aec7b25 100644
--- a/ldap/servers/plugins/replication/cl5_api.c
+++ b/ldap/servers/plugins/replication/cl5_api.c
@@ -5538,22 +5538,11 @@ static int _cl5GetFirstEntry (Object *obj, CL5Entry *entry, void **iterator, DB_
}
/* db error occured while iterating */
- if (rc != 0)
- {
- slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name_cl,
- "_cl5GetFirstEntry: failed to get entry; db error - %d %s\n", rc, db_strerror(rc));
- rc = CL5_DB_ERROR;
- goto done;
- }
-
- /* successfully retrieved next entry but it was out of range */
- if (rc == CL5_SUCCESS)
- {
- slapi_ch_free (&(key.data));
- slapi_ch_free (&(data.data));
- rc = CL5_NOTFOUND;
- goto done;
- }
+ /* On this path, the condition "rc != 0" cannot be false */
+ slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name_cl,
+ "_cl5GetFirstEntry: failed to get entry; db error - %d %s\n",
+ rc, db_strerror(rc));
+ rc = CL5_DB_ERROR;
done:;
/* error occured */
@@ -5621,15 +5610,11 @@ static int _cl5GetNextEntry (CL5Entry *entry, void *iterator)
}
/* cursor operation failed */
- if (rc != 0)
- {
- slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name_cl,
- "_cl5GetNextEntry: failed to get entry; db error - %d %s\n", rc, db_strerror(rc));
-
- return CL5_DB_ERROR;
- }
+ slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name_cl,
+ "_cl5GetNextEntry: failed to get entry; db error - %d %s\n",
+ rc, db_strerror(rc));
- return rc;
+ return CL5_DB_ERROR;
}
static int _cl5CurrentDeleteEntry (void *iterator)