Closed
Bug 505108
Opened 15 years ago
Closed 13 years ago
Early returns in Area::ParseCoords leak "char* cp"
Categories
(Core :: Layout, defect)
Tracking
()
RESOLVED
FIXED
mozilla7
People
(Reporter: jruderman, Assigned: jesup)
References
Details
(Keywords: memory-leak, valgrind)
Attachments
(1 file)
(deleted),
patch
|
roc
:
review+
jesup
:
checkin+
|
Details | Diff | Splinter Review |
Early returns in Area::ParseCoords leak "char* cp". Regression from bug 182554, I believe.
2 bytes in 2 blocks are definitely lost in loss record 15 of 1,703
malloc (vg_replace_malloc.c:193)
NS_Alloc_P (in /Users/jruderman/central/opt-obj/toolkit/library/XUL)
ToNewCString(nsAString_internal const&) (in /Users/jruderman/central/opt-obj/toolkit/library/XUL)
Area::ParseCoords(nsAString_internal const&) (in /Users/jruderman/central/opt-obj/toolkit/library/XUL)
RectArea::ParseCoords(nsAString_internal const&) (in /Users/jruderman/central/opt-obj/toolkit/library/XUL)
nsImageMap::AddArea(nsIContent*) (in /Users/jruderman/central/opt-obj/toolkit/library/XUL)
nsImageMap::SearchForAreas(nsIContent*, int&, int&) (in /Users/jruderman/central/opt-obj/toolkit/library/XUL)
nsImageMap::Init(nsIPresShell*, nsIFrame*, nsIDOMHTMLMapElement*) (in /Users/jruderman/central/opt-obj/toolkit/library/XUL)
nsImageFrame::GetImageMap(nsPresContext*) (in /Users/jruderman/central/opt-obj/toolkit/library/XUL)
nsImageFrame::PaintImage(nsIRenderingContext&, nsPoint, nsRect const&, imgIContainer*) (in /Users/jruderman/central/opt-obj/toolkit/library/XUL)
nsDisplayImage::Paint(nsDisplayListBuilder*, nsIRenderingContext*, nsRect const&) (in /Users/jruderman/central/opt-obj/toolkit/library/XUL)
nsDisplayClip::Paint(nsDisplayListBuilder*, nsIRenderingContext*, nsRect const&) (in /Users/jruderman/central/opt-obj/toolkit/library/XUL)
Reporter | ||
Comment 1•15 years ago
|
||
Assignee | ||
Comment 2•13 years ago
|
||
Also corrects that it was freeing the ToNewCString() string with NS_Free() when it's supposed to use nsMemory::Free().
Comment on attachment 538669 [details] [diff] [review]
Simple patch to correct this
Review of attachment 538669 [details] [diff] [review]:
-----------------------------------------------------------------
Attachment #538669 -
Flags: review?(roc) → review+
Comment 4•13 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla7
Comment 5•13 years ago
|
||
How significant was this leak? Each leak is a single byte (plus heap block overhead, presumably), how often did they occur?
Assignee | ||
Comment 6•13 years ago
|
||
Normally single byte (rounded up to allocation chunk size), plus an all-whitespace string would be leaked.
No idea how frequent; it's obviously wrong and was hit by Jesse's tracemalloc run (it appears). I'd *guess* infrequent to rare, but that's a guess.
Now fixed in any case. Don't count on it for anything significant; if you have testcases you can look before and after, or add a debug when it's hit.
Target Milestone: mozilla7 → ---
Assignee | ||
Updated•13 years ago
|
Attachment #538669 -
Flags: checkin+
Updated•13 years ago
|
Target Milestone: --- → mozilla7
Updated•6 years ago
|
Product: Core → Core Graveyard
Updated•6 years ago
|
Component: Layout: Misc Code → Layout
Product: Core Graveyard → Core
You need to log in
before you can comment on or make changes to this bug.
Description
•