diff options
author | Nathan Kinder <nkinder@redhat.com> | 2010-09-09 08:02:02 -0700 |
---|---|---|
committer | Nathan Kinder <nkinder@redhat.com> | 2010-09-09 13:40:36 -0700 |
commit | 0612f012834852d05f2a650596035e6e24e36a84 (patch) | |
tree | bb19173152717a614a74d941e711b765eb773ee1 /ldap/servers/slapd | |
parent | 47b3843284870848adc15bc4ab603f2cf0e5c7f7 (diff) | |
download | ds-0612f012834852d05f2a650596035e6e24e36a84.tar.gz ds-0612f012834852d05f2a650596035e6e24e36a84.tar.xz ds-0612f012834852d05f2a650596035e6e24e36a84.zip |
Bug 630094 - (cov#15458) Fix deadcode issue in moddn code
In the moddn code that renames child entries, the for loop used to
rename the children can never be executed. Part of the condition
is that retval is 0, but retval will always be -1 the first time we
hit this loop. This only happens with subtree rename off, but it
should still be fixed.
The fix is to set retval to 0 at the prior to checking the condition
the first time.
Diffstat (limited to 'ldap/servers/slapd')
-rw-r--r-- | ldap/servers/slapd/back-ldbm/ldbm_modrdn.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_modrdn.c b/ldap/servers/slapd/back-ldbm/ldbm_modrdn.c index 293924e8..c8b49035 100644 --- a/ldap/servers/slapd/back-ldbm/ldbm_modrdn.c +++ b/ldap/servers/slapd/back-ldbm/ldbm_modrdn.c @@ -1578,7 +1578,7 @@ moddn_rename_children( */ slapi_pblock_get( pb, SLAPI_OPERATION, &operation ); opcsn = operation_get_csn (operation); - for (i=0; retval == 0 && child_entries[i] && child_entry_copies[i]; i++) { + for (i=0,retval=0; retval == 0 && child_entries[i] && child_entry_copies[i]; i++) { retval = moddn_rename_child_entry(ptxn, pb, li, child_entries[i], child_entry_copies[i], parentdncomps, newsuperiordns, newsuperiordncomps, |