Closed Bug 475702 Opened 15 years ago Closed 15 years ago

nsICertOverrideService.rememberValidityOverride leaks an nsStringBuffer for each call

Categories

(Core :: Security: PSM, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9.2a1

People

(Reporter: mossop, Assigned: mossop)

References

Details

(Keywords: fixed1.9.1, memory-leak)

Attachments

(1 file, 2 obsolete files)

The tests in bug 435743 are revealing some memory leaks, looks like a few different ones.

One is that adding the BadCertHandler to the notificationCallbacks of an XMLHttpRequest channel and then requesting a https URL where the cert is untrusted causes us to leak.

I don't think this is an EM bug but tracking it here for now.
Assignee: nobody → kaie
Component: Add-ons Manager → Security: PSM
Product: Toolkit → Core
QA Contact: add-ons.manager → psm
Summary: Memory leak when retrieving update.rdf from a bad ssl server → Use of nsIBadCertListener2 leaks
Attached patch patch rev 1 (obsolete) — Splinter Review
Ok we're simply leaking the proxy to the nsIBadCertListener2 whenever it is used.
Assignee: kaie → dtownsend
Status: NEW → ASSIGNED
Attachment #359249 - Flags: review?(kaie)
Attached patch patch rev 2 (obsolete) — Splinter Review
Might as well fix this other PSM leak here too.

nsStringBuffer::Alloc returns an already AddRefed string buffer so assigning to the nsRefPtr pushes the refcount too high. There doesn't seem much of a need of the nsRefPtr anyway so just release it when done.
Attachment #359249 - Attachment is obsolete: true
Attachment #359282 - Flags: review?(kaie)
Attachment #359249 - Flags: review?(kaie)
Blocks: 413909
Attached patch patch rev 3Splinter Review
Ok so the badcertlistener leak already has a patch in bug 459657 so I'll just cover the stringbuffer leak here.
Attachment #359282 - Attachment is obsolete: true
Attachment #359291 - Flags: review?(kaie)
Attachment #359282 - Flags: review?(kaie)
Summary: Use of nsIBadCertListener2 leaks → nsICertOverrideService.rememberValidityOverride leaks an nsStringBuffer for each call
Blocks: 435743
Attachment #359291 - Flags: review?(kaie) → review+
Comment on attachment 359291 [details] [diff] [review]
patch rev 3

r=kaie thanks for the patch
Pushed: http://hg.mozilla.org/mozilla-central/rev/c834f54de201
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.2a1
Comment on attachment 359291 [details] [diff] [review]
patch rev 3

Looking for approval to land this small leak fix on the branch. Very low risk
Attachment #359291 - Flags: approval1.9.1?
Comment on attachment 359291 [details] [diff] [review]
patch rev 3

a191=beltzner
Attachment #359291 - Flags: approval1.9.1? → approval1.9.1+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: