Closed Bug 1209435 Opened 9 years ago Closed 9 years ago

[Coverity 1123223] Leak of memory or pointers to system resources in NSC_SignInit

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

Two occurrences:

> case CKM_NSS_HMAC_CONSTANT_TIME: {
>   sftk_MACConstantTimeCtx *ctx =
>       sftk_HMACConstantTime_New(pMechanism,key);
>   CK_ULONG *intpointer;
>   
>   if (ctx == NULL) {
>       crv = CKR_ARGUMENTS_BAD;
>       break;
>   }
>   intpointer = PORT_New(CK_ULONG);
>   if (intpointer == NULL) {
>       crv = CKR_HOST_MEMORY;
>       break;
>   }

> case CKM_NSS_SSL3_MAC_CONSTANT_TIME: {
>   sftk_MACConstantTimeCtx *ctx =
>       sftk_SSLv3MACConstantTime_New(pMechanism,key);
>   CK_ULONG *intpointer;
>   
>   if (ctx == NULL) {
>       crv = CKR_ARGUMENTS_BAD;
>       break;
>   }
>   intpointer = PORT_New(CK_ULONG);
>   if (intpointer == NULL) {
>       crv = CKR_HOST_MEMORY;
>       break;
>   }

3. alloc_fn: Storage is returned from allocation function sftk_SSLv3MACConstantTime_New.

4. var_assign: Assigning: ctx = storage returned from sftk_SSLv3MACConstantTime_New(pMechanism, key).

8. leaked_storage: Variable ctx going out of scope leaks the storage it points to.
Assignee: nobody → ttaubert
Status: NEW → ASSIGNED
Patch at: https://codereview.appspot.com/265320043
Flags: needinfo?(martin.thomson)
Flags: needinfo?(ekr)
LGTM
Flags: needinfo?(ekr)
https://hg.mozilla.org/projects/nss/rev/924c6ad4a9c1
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.