Last Comment Bug 434860 - Coverity 1150 - dead code in ocsp_CreateCertID
: Coverity 1150 - dead code in ocsp_CreateCertID
Status: RESOLVED FIXED
:
Product: NSS
Classification: Components
Component: Libraries (show other bugs)
: trunk
: All All
: P4 trivial (vote)
: 3.12.1
Assigned To: Julien Pierre
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-05-20 14:48 PDT by Nelson Bolyard (seldom reads bugmail)
Modified: 2008-05-20 16:34 PDT (History)
1 user (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
Remove dead code (743 bytes, patch)
2008-05-20 15:02 PDT, Julien Pierre
nelson: review+
Details | Diff | Splinter Review

Description Nelson Bolyard (seldom reads bugmail) 2008-05-20 14:48:19 PDT
Found by Coverity on its last Firefox 3 test run, 2007-May-14 
CID 1150
In function ocsp_CreateCertID, variable tempItem is initialized to NULL

1593 	    SECItem *tempItem = NULL;

and then is not touched again until label loser, where it is checked for NULL.

1665 	    if (tempItem != NULL) {
1666 		SECITEM_FreeItem(tempItem, PR_TRUE);
1667 	    }

That condition can never be true.  It's dead code.  All the lines shown
above should be removed.
Comment 1 Julien Pierre 2008-05-20 15:02:42 PDT
Created attachment 321832 [details] [diff] [review]
Remove dead code
Comment 2 Nelson Bolyard (seldom reads bugmail) 2008-05-20 16:28:48 PDT
Comment on attachment 321832 [details] [diff] [review]
Remove dead code

r+
Comment 3 Julien Pierre 2008-05-20 16:34:22 PDT
Thanks for the review, Nelson.

Checking in ocsp.c;
/cvsroot/mozilla/security/nss/lib/certhigh/ocsp.c,v  <--  ocsp.c
new revision: 1.51; previous revision: 1.50
done

Note You need to log in before you can comment on or make changes to this bug.