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

RESOLVED FIXED

Status

RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: ttaubert, Assigned: ttaubert)

Tracking

(Blocks: 1 bug)

Firefox Tracking Flags

(firefox44 affected)

Details

(Assignee)

Description

3 years ago
> 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.
(Assignee)

Comment 1

3 years ago
Patch at: https://codereview.appspot.com/263450043
Assignee: nobody → ttaubert
Status: NEW → ASSIGNED
Flags: needinfo?(martin.thomson)
Flags: needinfo?(ekr)

Comment 2

3 years ago
LGTM
Flags: needinfo?(ekr)
https://hg.mozilla.org/projects/nss/rev/61d8f4ac8b2f
Status: ASSIGNED → RESOLVED
Last Resolved: 3 years ago
Flags: needinfo?(martin.thomson)
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.