Closed Bug 530090 Opened 15 years ago Closed 15 years ago

[HTML5] Memory leaks using jArray in HTML5 parser

Categories

(Core :: DOM: HTML Parser, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: zbychs, Unassigned)

References

()

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; pl; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 4.0.20506) FBSMTWB
Build Identifier: 

There are some minor memory leaks here: http://mxr.mozilla.org/mozilla-central/source/parser/html/nsHtml5Tokenizer.h#284 as well as in several simillar places.
The reason for those leaks is that constructor that initializes the 0-length jArray  allocates 0-length buffer, which is never deleted.
Fixing bug 502176 would make this one obsolete.

Note from Henri Sivonen:
"The definitions are in generated code that shouldn't be patched directly. A patch for the generator or to jArray.h would be awesome, though. Since jArray.h needs to be able to represent null, I think probably the right fix is to make jArray.h behave differently when 0 is assigned to it."

Reproducible: Always
Editing summary to put this on the radar. Thanks for finding this and providing a patch.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: Memory leaks using jArray in HTML5 parser → [HTML5] Memory leaks using jArray in HTML5 parser
Comment on attachment 413623 [details] [diff] [review]
Quick and dirty fix of memory leaks.

r=hsivonen. I'll land this.
Attachment #413623 - Flags: review+
Thank you for the patch. Pushed:
http://hg.mozilla.org/mozilla-central/rev/8cdb992f92f7
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: