Closed Bug 1209443 Opened 9 years ago Closed 9 years ago

[Coverity 1078810] Leak of memory or pointers to system resources in pk11_keyIDHash_populate

Categories

(NSS :: Libraries, defect)

defect
Not set
normal

Tracking

(firefox44 affected)

RESOLVED FIXED
Tracking Status
firefox44 --- affected

People

(Reporter: ttaubert, Assigned: ttaubert)

References

(Blocks 1 open bug)

Details

> slotid = SECITEM_AllocItem(NULL, NULL,
>                            sizeof(CK_SLOT_ID) + sizeof(SECMODModuleID));
> if (!slotid) {
>     PORT_SetError(SEC_ERROR_NO_MEMORY);
>     return PR_FAILURE;
> }
> moduleLock = SECMOD_GetDefaultModuleListLock();
> if (!moduleLock) {
>     PORT_SetError(SEC_ERROR_NOT_INITIALIZED);
>     return PR_FAILURE;
> }

14. alloc_fn: Storage is returned from allocation function SECITEM_AllocItem_Util.

15. var_assign: Assigning: slotid = storage returned from SECITEM_AllocItem_Util(NULL, NULL, 16U).

18. leaked_storage: Variable slotid going out of scope leaks the storage it points to.
Patch at: https://codereview.appspot.com/263450043
Assignee: nobody → ttaubert
Status: NEW → ASSIGNED
Flags: needinfo?(martin.thomson)
Flags: needinfo?(ekr)
LGTM
Flags: needinfo?(ekr)
https://hg.mozilla.org/projects/nss/rev/61d8f4ac8b2f
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Flags: needinfo?(martin.thomson)
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.