Coverity 321, dead code in mozilla/security/nss/lib/pk11wrap/pk11cert.c

RESOLVED FIXED in 3.11.2

Status

NSS
Libraries
P3
trivial
RESOLVED FIXED
12 years ago
10 years ago

People

(Reporter: Jon Smirl, Assigned: Alexei Volkov)

Tracking

({coverity})

3.11
3.11.2
coverity

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [CID 149 321 834])

Attachments

(2 attachments)

(Reporter)

Description

12 years ago
This is just wrong and should be removed. 

@@ -1319,7 +1319,6 @@
     /* get them all! */
     list = PK11_GetAllTokens(CKM_INVALID_MECHANISM,PR_FALSE,PR_TRUE,wincx);
     if (list == NULL) {
-       if (list) PK11_FreeSlotList(list);
        return CK_INVALID_HANDLE;
     }
(Reporter)

Comment 1

12 years ago
Created attachment 221327 [details] [diff] [review]
remove dead code in error path
(Reporter)

Comment 2

12 years ago
Same problem in a different place

@@ -1084,7 +1084,6 @@
     /* get them all! */
     list = PK11_GetAllTokens(CKM_INVALID_MECHANISM,PR_FALSE,PR_TRUE,wincx);
     if (list == NULL) {
-       if (list) PK11_FreeSlotList(list);
        return CK_INVALID_HANDLE;
     }
(Reporter)

Updated

12 years ago
Attachment #221327 - Flags: review?(wtchang)
(Reporter)

Updated

12 years ago
Keywords: coverity
Severity: normal → trivial
Priority: -- → P3

Updated

12 years ago
Attachment #221327 - Flags: review?(wtchang) → review+
(Assignee)

Comment 3

12 years ago
trunk
/cvsroot/mozilla/security/nss/lib/pk11wrap/pk11cert.c,v  <--  pk11cert.c
new revision: 1.147; previous revision: 1.146

3.11 branch
/cvsroot/mozilla/security/nss/lib/pk11wrap/pk11cert.c,v  <--  pk11cert.c
new revision: 1.143.2.3; previous revision: 1.143.2.2
Status: NEW → RESOLVED
Last Resolved: 12 years ago
Resolution: --- → FIXED
Assignee: nobody → alexei.volkov.bugs
reopening.  
This bug is one of several that has several complaints about a file,
and includes a patch that only fixes one of them. 
Checking in the fix for one of them doesn't resolve the whole bug.
Please re-review all the coverity bugs recently marked RESOLVED/FIXED
to make sure that all the problems reported in the bug were fixed, 
and not only just the first one.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
(Assignee)

Comment 5

12 years ago
Created attachment 222411 [details] [diff] [review]
fix two more places
Attachment #222411 - Flags: review?(nelson)
Comment on attachment 222411 [details] [diff] [review]
fix two more places

r=nelson
Attachment #222411 - Flags: review?(nelson) → review+
(Assignee)

Comment 7

12 years ago
second patch:

trunk:
/cvsroot/mozilla/security/nss/lib/pk11wrap/pk11cert.c,v  <--  pk11cert.c
new revision: 1.150; previous revision: 1.149

3.11 branch:
/cvsroot/mozilla/security/nss/lib/pk11wrap/pk11cert.c,v  <--  pk11cert.c
new revision: 1.143.2.6; previous revision: 1.143.2.5
Status: REOPENED → RESOLVED
Last Resolved: 12 years ago12 years ago
Resolution: --- → FIXED
Whiteboard: [CID 321]
Also CID 149
Whiteboard: [CID 321] → [CID 149 321]
*** Bug 337633 has been marked as a duplicate of this bug. ***
Whiteboard: [CID 149 321] → [CID 149 321 834]
You need to log in before you can comment on or make changes to this bug.