Closed Bug 485732 Opened 15 years ago Closed 10 years ago

nsslowcert_OpenCertDB leaks a PRMonitor on failure

Categories

(NSS :: Libraries, defect, P3)

3.11

Tracking

(Not tracked)

RESOLVED FIXED
3.16.2

People

(Reporter: nelson, Assigned: Cykesiopka)

References

Details

(Keywords: memory-leak, Whiteboard: FIPS)

Attachments

(1 file, 1 obsolete file)

nsslowcert_OpenCertDB allocates a PRMonitor, and then calls 
nsslowcert_OpenPermCertDB.  If that call fails, nsslowcert_OpenCertDB 
returns without destroying the PRMonitor.  This generally happens during
a call to NSS_Init, and the failure causes NSS_Init to fail, so the 
application does not call NSS_Shutdown.  Consequently, the PRMonitor is 
leaked.  See bug 447845 for the leak stack.

This has raised the questions: 
When NSS_Init fails, should an application try to call NSS_Shutdown anyway?  
Would doing so fix this leak?
Priority: -- → P3
Whiteboard: FIPS
Assignee: nobody → rrelyea
Attached patch bug485732_v1.patch (obsolete) — Splinter Review
Attachment #8428438 - Flags: review?(emaldona)
Comment on attachment 8428438 [details] [diff] [review]
bug485732_v1.patch

Review of attachment 8428438 [details] [diff] [review]:
-----------------------------------------------------------------

::: lib/softoken/legacydb/pcertdb.c
@@ +4597,5 @@
>  	goto loser;
>      }
>  
>      return (SECSuccess);
>      

Nitpick: whitespace
Attachment #8428438 - Flags: review?(emaldona) → review+
+ Fix whitespace

Thanks for the review!
Assignee: rrelyea → cykesiopka.bmo
Attachment #8428438 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Keywords: checkin-needed
Comment on attachment 8430457 [details] [diff] [review]
bug485732_v2.patch

Review of attachment 8430457 [details] [diff] [review]:
-----------------------------------------------------------------

Looks like a new version of the patch. It now has 2 reviews (elio and mine).
Attachment #8430457 - Flags: review+
https://hg.mozilla.org/projects/nss/rev/2a654ae92851
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → 3.16.2
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: