Closed
Bug 399022
Opened 17 years ago
Closed 17 years ago
Leak-prone code in nsCertTree
Categories
(Core :: Security: PSM, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: bzbarsky, Assigned: KaiE)
References
Details
(Keywords: memory-leak, regression)
Attachments
(1 file, 1 obsolete file)
7.52 KB,
patch
|
KaiE
:
review+
sayrer
:
approval1.9+
|
Details | Diff | Splinter Review |
See bug 327181 comment 134 and bug 327181 comment 135. I'm not quite sure how this code got review, and more importantly how it got sr. Then again, as far as I can see it in fact did not get sr.
Flags: blocking1.9?
Reporter | ||
Updated•17 years ago
|
Blocks: https-error-pages
Updated•17 years ago
|
Keywords: mlk,
regression
Assignee | ||
Comment 1•17 years ago
|
||
Copying over the comments: > So is there a reason the nsCertTree code doesn't use alread_AddRefed<> for the > addrefed pointers it returns? Then you wouldn't need to sprinkle > getter_AddRefs all over where it's used.... > I'm also a little confused as to why we're manually addreffing/releasing stuff > before putting it in mDispInfo.
Assignee | ||
Comment 2•17 years ago
|
||
(In reply to comment #1) > So is there a reason the nsCertTree code doesn't use alread_AddRefed<> for the > addrefed pointers it returns? Then you wouldn't need to sprinkle > getter_AddRefs all over where it's used.... The reason is, I didn't think of it :-) Thanks for your proposal. I guess you're referring to the two private functions, and I'll change them. Regarding the interface functions, IIUC we can't use already_AddRefed. > I'm also a little confused as to why we're manually addreffing/releasing stuff > before putting it in mDispInfo. Earlier versions of the patch used an array of raw pointers, I converted it to an array of nsRefPtr late in the game. I agree when using nsRefPtr the manual addref/release is no longer required.
Attachment #284028 -
Flags: review?(bzbarsky)
Reporter | ||
Comment 3•17 years ago
|
||
Comment on attachment 284028 [details] [diff] [review] Patch v1 r=bzbarsky. Thanks for the quick fix!
Attachment #284028 -
Flags: review?(bzbarsky) → review+
Assignee | ||
Updated•17 years ago
|
Attachment #284028 -
Flags: superreview?(rrelyea)
Assignee | ||
Comment 4•17 years ago
|
||
Sorry, the previous patch didn't compile. I had to add one more change: @@ -868,7 +864,7 @@ NS_IMETHODIMP nsCertTree::GetCert(PRUint32 aIndex, nsIX509Cert **_cert) { NS_ENSURE_ARG(_cert); - *_cert = GetCertAtIndex(aIndex); + *_cert = GetCertAtIndex(aIndex).get(); return NS_OK; } This should be ok. The get() function doesn't do anything, it just returns the raw pointer (which already has its reference counter set).
Attachment #284028 -
Attachment is obsolete: true
Attachment #284045 -
Flags: superreview?(rrelyea)
Attachment #284045 -
Flags: review+
Attachment #284028 -
Flags: superreview?(rrelyea)
Comment 5•17 years ago
|
||
I'm not sure I'm the best person to sr code based on the mozilla reference model.
Assignee | ||
Comment 6•17 years ago
|
||
Comment on attachment 284045 [details] [diff] [review] Patch v2 Boris, do you think we'll need another review? As this patch is really about addressing your review comments from bug 327181, I'd say it's not necessary.
Attachment #284045 -
Flags: superreview?(rrelyea)
Reporter | ||
Comment 7•17 years ago
|
||
I don't know what the current review regime in PSM is. If only one review is needed, I think we'refine.
Assignee | ||
Comment 8•17 years ago
|
||
Comment on attachment 284045 [details] [diff] [review] Patch v2 (In reply to comment #7) > I don't know what the current review regime in PSM is. If only one review is > needed, I think we'refine. If a module-owner/peer created the patch, review from the module-owner/peer is sufficient. As this is a correctness fix, not changing any PSM logic, I think your review was really a superreview and is sufficient for check in.
Attachment #284045 -
Flags: approval1.9?
Updated•17 years ago
|
Attachment #284045 -
Flags: approval1.9? → approval1.9+
Assignee | ||
Comment 9•17 years ago
|
||
checked in, marking fixed.
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 10•17 years ago
|
||
Reopening bug. All patches that got checked in to trunk yesterday are being backed out, because it's unclear which patch has caused a performance regression.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Assignee | ||
Comment 11•17 years ago
|
||
checked in again, marking fixed.
Status: REOPENED → RESOLVED
Closed: 17 years ago → 17 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•