Closed Bug 135818 Opened 22 years ago Closed 22 years ago

Internal slot reference leaks in lib/pk11wrap/pk11slot.c

Categories

(NSS :: Libraries, defect, P1)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: wtc, Assigned: rrelyea)

References

Details

(Whiteboard: [adt2 RTM])

Attachments

(1 file)

1. PK11_VerifySlotMechanisms() calls PK11_GetInternalSlot() and
that slot reference is not freed on this error path:

1568     /* don't blow up just because the card supports more mechanisms than
1569      * we know about, just alloc space for them */
1570     if (count > MAX_MECH_LIST_SIZE) {
1571         mechList = (CK_MECHANISM_TYPE *)
1572                             PORT_Alloc(count *sizeof(CK_MECHANISM_TYPE));
1573         alloced = PR_TRUE;
1574         if (mechList == NULL) return PR_FALSE;
1575     }

2. PK11_InitToken() calls PK11_GetInternalSlot() and does not
free that slot reference.

3. PK11_MapPBEMechanismToCryptoMechanism() calls PK11_GetInternalSlot()
but does not free that slot reference.
Changed the QA contact to Bishakha.
QA Contact: sonja.mirtitsch → bishakhabanerjee
Bob fixed the third leak (in PK11_MapPBEMechanismToCryptoMechanism())
in rev. 1.36 of pk11slot.c.

This patch fixes the first two leaks.  Bob, please review.  Thanks.
Assigned the bug to Bob.
Assignee: wtc → relyea
Priority: -- → P1
Target Milestone: --- → 3.5
Comment on attachment 82963 [details] [diff] [review]
Proposed patch for leaks #1 and #2

Both cases look good
Attachment #82963 - Flags: review+
Fix checked into the tip of NSS.
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Blocks: 145836
adt1.0.1+ (on ADT's behalf) for checkin to the 1.0 branch. Pls check this in
asap. thanks! 
Whiteboard: [adt2 RTM]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: