Description of problem: fix coverity Defect Type: Code maintainability issues
Created attachment 437967 [details] git patch file (master) Comment: The str assignment on line 1240 can be removed because the value is not needed or will be overwritten.
(In reply to comment #1) > Created an attachment (id=437967) [details] > git patch file (master) > > Comment: > The str assignment on line 1240 can be removed because the value > is not needed or will be overwritten. http://10.16.47.145:8080/sourcebrowser.htm?projectId=10030#mergedDefectId=12248&streamDefectId=12434&defectInstanceId=14324&fileInstanceId=49281
Created attachment 437971 [details] git patch file (master) http://10.16.47.145:8080/sourcebrowser.htm?projectId=10030#mergedDefectId=12249&streamDefectId=12435&defectInstanceId=14325&fileInstanceId=49281 Comment: The call to strchr() is unnecessary because strcpy() will ensure that string p is NULL-terminated. http://10.16.47.145:8080/sourcebrowser.htm?projectId=10030#mergedDefectId=12250&streamDefectId=12436&defectInstanceId=14326&fileInstanceId=49281 Comment: The call to strchr() is unnecessary because strcpy() will ensure that string p is NULL-terminated.
Created attachment 437974 [details] git patch file (master) http://10.16.47.145:8080/sourcebrowser.htm?projectId=10030#mergedDefectId=12251&streamDefectId=12437&defectInstanceId=14327&fileInstanceId=49278 Comment: The "word" assignment on line 961 and 963 is unnecessary because the value will be overwritten. http://10.16.47.145:8080/sourcebrowser.htm?projectId=10030#mergedDefectId=12252&streamDefectId=12438&defectInstanceId=14329&fileInstanceId=49278 Comment: The "s" assignments on line 271, 280, and 281 are unnecessary because the value is never used.
Comment on attachment 437974 [details] git patch file (master) Wrong attachment
Created attachment 437988 [details] git patch file (master) git patch file (master) http://10.16.47.145:8080/sourcebrowser.htm?projectId=10030#mergedDefectId=12251&streamDefectId=12437&defectInstanceId=14327&fileInstanceId=49278 Comment: The "word" assignment on line 961 and 963 is unnecessary because the value will be overwritten. http://10.16.47.145:8080/sourcebrowser.htm?projectId=10030#mergedDefectId=12252&streamDefectId=12438&defectInstanceId=14329&fileInstanceId=49278 Comment: The "s" assignments on line 271, 280, and 281 are unnecessary because the value is never used.
Created attachment 437989 [details] git patch file (master) http://10.16.47.145:8080/sourcebrowser.htm?projectId=10030#mergedDefectId=12253&streamDefectId=12439&defectInstanceId=14332&fileInstanceId=49208 Comment: The result of PR_HashTableAdd() should be checked for NULL value.
Created attachment 437992 [details] git patch file (master) 12254 http://10.16.47.145:8080/sourcebrowser.htm?projectId=10030#mergedDefectId=12254&streamDefectId=12440&defectInstanceId=14333&fileInstanceId=49276 Comment: The "ptr" assignment on line 2622 is unnecessary because the value is never used. 12255 http://10.16.47.145:8080/sourcebrowser.htm?projectId=10030#mergedDefectId=12255&streamDefectId=12441&defectInstanceId=14334&fileInstanceId=49276 Comment: The "word" assignment on line 2630 can be removed because the first token is ignored. Alternatively the value should be validated. 12256 http://10.16.47.145:8080/sourcebrowser.htm?projectId=10030#mergedDefectId=12256&streamDefectId=12442&defectInstanceId=14335&fileInstanceId=49276 Comment: The "ptr" assignment on line 1456 is unnecessary because the value is not used. 12257 http://10.16.47.145:8080/sourcebrowser.htm?projectId=10030#mergedDefectId=12257&streamDefectId=12443&defectInstanceId=14336&fileInstanceId=49276 Comment: The "word" assignment on line 1463 can be removed because the first token is ignored. Alternatively the value should be validated. 12258 http://10.16.47.145:8080/sourcebrowser.htm?projectId=10030#mergedDefectId=12258&streamDefectId=12444&defectInstanceId=14337&fileInstanceId=49276 Comment: The "ptr" assignment on line 1210 is unnecessary because the value is never used. 12259 http://10.16.47.145:8080/sourcebrowser.htm?projectId=10030#mergedDefectId=12259&streamDefectId=12445&defectInstanceId=14338&fileInstanceId=49276 Comment: The "word" assignment on line 1217 can be removed because the first token is ignored. Alternatively the value should be validated.
Created attachment 437996 [details] git patch file (master) 12260 http://10.16.47.145:8080/sourcebrowser.htm?projectId=10030#mergedDefectId=12260&streamDefectId=12446&defectInstanceId=14339&fileInstanceId=49364 Comment: The "bval" assignment on line 636 can be removed because any value is accepted. Note: This is to set debug mode "cb_set_debug(1)" which is enabled by having nsDebug in the chaining config entry.
Created attachment 438002 [details] git patch file (master) 12261 http://10.16.47.145:8080/sourcebrowser.htm?projectId=10030#mergedDefectId=12261&streamDefectId=12447&defectInstanceId=14340&fileInstanceId=49519 Comment: Pointer "replica" returned by "object_get_data(prp->replica_object)" (line 826) is never used. In "case STATE_READY_TO_ACQUIRE", Replica object "replica" is not needed.
Created attachment 438016 [details] git patch file (master) 12262 http://10.16.47.145:8080/sourcebrowser.htm?projectId=10030#mergedDefectId=12262&streamDefectId=12448&defectInstanceId=14341&fileInstanceId=49526 Comment: The return value from object_get_data is assigend to ruv just to check if repl_ruv object exists or not with PR_ASSERT in the DEBUG mode (line 218). Passing the object_get_data call to PR_ASSERT directly.
Created attachment 438018 [details] git patch file (master) 12263 http://10.16.47.145:8080/sourcebrowser.htm?projectId=10030#mergedDefectId=12263&streamDefectId=12449&defectInstanceId=14342&fileInstanceId=49541 Comment: Pointer "replica" returned by "object_get_data(prp->replica_object)" (line 502) is never used. In "case STATE_READY_TO_ACQUIRE", Replica object "replica" is not needed.
Created attachment 438021 [details] git patch file (master) 12264 http://10.16.47.145:8080/sourcebrowser.htm?projectId=10030#mergedDefectId=12264&streamDefectId=12450&defectInstanceId=14343&fileInstanceId=49587 Comment: The "cn" assignment on line 221 can be removed because it is not needed.
Created attachment 438029 [details] git patch file (master) 12265 http://10.16.47.145:8080/sourcebrowser.htm?projectId=10030#mergedDefectId=12265&streamDefectId=12451&defectInstanceId=14344&fileInstanceId=49296 Comment: Pointer "log_dir" returned by "dblayer_get_home_dir(li, NULL)" is never used (line 1492). Removing the unnecessary else clause.
Created attachment 438031 [details] git patch file (master) 12266 http://10.16.47.145:8080/sourcebrowser.htm?projectId=10030#mergedDefectId=12266&streamDefectId=12452&defectInstanceId=14345&fileInstanceId=49321 Comment: The "p" assignments on line 260, 264, and 268 can be removed because they are not needed.
Created attachment 438034 [details] git patch file (master) 12267 http://10.16.47.145:8080/sourcebrowser.htm?projectId=10030#mergedDefectId=12267&streamDefectId=12453&defectInstanceId=14348&fileInstanceId=49335 Comment: Calling slapi_sdn_get_dn and assigning the return value to base is not needed.
Created attachment 438042 [details] git patch file (master) 12268 http://10.16.47.145:8080/sourcebrowser.htm?projectId=10030#mergedDefectId=12268&streamDefectId=12454&defectInstanceId=14349&fileInstanceId=49648 Comment: Pointer "slapdFrontendConfig" returned by "init_config" is never used (line 244).
Created attachment 438237 [details] git patch file (master) 12269 http://10.16.47.145:8080/sourcebrowser.htm?projectId=10030#mergedDefectId=12269&streamDefectId=12455&defectInstanceId=14350&fileInstanceId=49809 Comment: The "new_row" assignment on line 87 can be removed because it is not needed.
Created attachment 438247 [details] git patch file (master) 12253 http://10.16.47.145:8080/sourcebrowser.htm?projectId=10030#mergedDefectId=12253&streamDefectId=12439&defectInstanceId=14332&fileInstanceId=49208 12270 http://10.16.47.145:8080/sourcebrowser.htm?projectId=10030#mergedDefectId=12270&streamDefectId=12456&defectInstanceId=14351&fileInstanceId=49208 Comment: The result of PR_HashTableAdd() should be checked for NULL value. Applied the change to all the PR_HashTableAdd calls in this file lib/libaccess/register.cpp.
Reviewed by Nathan (Thank you!!!) Pushed to master. $ git push Counting objects: 130, done. Delta compression using up to 4 threads. Compressing objects: 100% (101/101), done. Writing objects: 100% (102/102), 11.25 KiB, done. Total 102 (delta 78), reused 0 (delta 0) To ssh://git.fedorahosted.org/git/389/ds.git 100785a..79e2e7d master -> master