Browse Source

610281 - fix coverity Defect Type: Control flow issues

https://bugzilla.redhat.com/show_bug.cgi?id=610281

11820 DEADCODE Triaged Unassigned Bug Minor Fix Required
idl_new_delete_key() ds/ldap/servers/slapd/back-ldbm/idl_new.c

Comment:
tmpid is no longer used. Since we don't define DB_ALLIDS_ON_WRITE, ALLID has no chance to be stored in the db. But the code should be fixed as follows:
Remove:
480 ID tmpid = 0;
The 496 must be
496 if (id == ALLID) {
Noriko Hosoi 15 years ago
parent
commit
a24a746c02
1 changed files with 1 additions and 2 deletions
  1. 1 2
      ldap/servers/slapd/back-ldbm/idl_new.c

+ 1 - 2
ldap/servers/slapd/back-ldbm/idl_new.c

@@ -437,7 +437,6 @@ int idl_new_delete_key(
     int ret = 0;
     DBC *cursor = NULL;
     DBT data = {0};
-    ID tmpid = 0;
 
     /* Make a cursor */
     ret = db->cursor(db,txn,&cursor,0);
@@ -453,7 +452,7 @@ int idl_new_delete_key(
     /* Position cursor at the key, value pair */
     ret = cursor->c_get(cursor,key,&data,DB_GET_BOTH);
     if (0 == ret) {
-        if (tmpid == ALLID) {
+        if (id == ALLID) {
             goto error;	/* allid: never delete it */
         }
     } else {