RESOLVED FIXED 55249
Leak in JSParser::Scope of ScopeLabelInfo Vector
https://bugs.webkit.org/show_bug.cgi?id=55249
Summary Leak in JSParser::Scope of ScopeLabelInfo Vector
Michael Saboff
Reported 2011-02-25 11:32:16 PST
In the struct Scope, the fuction pushLabel creates a LabelStack as needed that never gets cleaned up. void pushLabel(const Identifier* label, bool isLoop) { if (!m_labels) m_labels = new LabelStack; m_labels->append(ScopeLabelInfo(label->impl(), isLoop)); }
Attachments
Added Destructor to clean up JSParser::Scope leak of ScopeLabelInfo Vector (1.20 KB, patch)
2011-02-25 11:39 PST, Michael Saboff
darin: review+
Michael Saboff
Comment 1 2011-02-25 11:39:14 PST
Created attachment 83857 [details] Added Destructor to clean up JSParser::Scope leak of ScopeLabelInfo Vector
Darin Adler
Comment 2 2011-02-25 11:42:19 PST
Comment on attachment 83857 [details] Added Destructor to clean up JSParser::Scope leak of ScopeLabelInfo Vector View in context: https://bugs.webkit.org/attachment.cgi?id=83857&action=review I’d rather see m_labels be changed to an OwnPtr than just add the missing deletion. > Source/JavaScriptCore/parser/JSParser.cpp:300 > + if (m_labels) > + delete m_labels; The if isn’t needed. C++ defines the delete operator to do nothing if the pointer passed is null.
Michael Saboff
Comment 3 2011-02-25 17:27:17 PST
Note You need to log in before you can comment on or make changes to this bug.