<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>55249</bug_id>
          
          <creation_ts>2011-02-25 11:32:16 -0800</creation_ts>
          <short_desc>Leak in JSParser::Scope of ScopeLabelInfo Vector</short_desc>
          <delta_ts>2011-02-25 17:27:17 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>JavaScriptCore</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>OS X 10.5</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael Saboff">msaboff</reporter>
          <assigned_to name="Michael Saboff">msaboff</assigned_to>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>358084</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Saboff">msaboff</who>
    <bug_when>2011-02-25 11:32:16 -0800</bug_when>
    <thetext>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-&gt;append(ScopeLabelInfo(label-&gt;impl(), isLoop));
        }</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>358090</commentid>
    <comment_count>1</comment_count>
      <attachid>83857</attachid>
    <who name="Michael Saboff">msaboff</who>
    <bug_when>2011-02-25 11:39:14 -0800</bug_when>
    <thetext>Created attachment 83857
Added Destructor to clean up JSParser::Scope leak of ScopeLabelInfo Vector</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>358092</commentid>
    <comment_count>2</comment_count>
      <attachid>83857</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2011-02-25 11:42:19 -0800</bug_when>
    <thetext>Comment on attachment 83857
Added Destructor to clean up JSParser::Scope leak of ScopeLabelInfo Vector

View in context: https://bugs.webkit.org/attachment.cgi?id=83857&amp;action=review

I’d rather see m_labels be changed to an OwnPtr than just add the missing deletion.

&gt; Source/JavaScriptCore/parser/JSParser.cpp:300
&gt; +            if (m_labels)
&gt; +                delete m_labels;

The if isn’t needed. C++ defines the delete operator to do nothing if the pointer passed is null.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>358302</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Saboff">msaboff</who>
    <bug_when>2011-02-25 17:27:17 -0800</bug_when>
    <thetext>Committed r79749: &lt;http://trac.webkit.org/changeset/79749&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>83857</attachid>
            <date>2011-02-25 11:39:14 -0800</date>
            <delta_ts>2011-02-25 11:42:19 -0800</delta_ts>
            <desc>Added Destructor to clean up JSParser::Scope leak of ScopeLabelInfo Vector</desc>
            <filename>55249.patch</filename>
            <type>text/plain</type>
            <size>1225</size>
            <attacher name="Michael Saboff">msaboff</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9KYXZhU2NyaXB0Q29yZS9DaGFuZ2VMb2cKPT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gU291
cmNlL0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwkocmV2aXNpb24gNzk3MDgpCisrKyBTb3VyY2Uv
SmF2YVNjcmlwdENvcmUvQ2hhbmdlTG9nCSh3b3JraW5nIGNvcHkpC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AgICAgICAgICAgICBkZWxldGUgbV9sYWJlbHM7CisgICAgICAgIH0KKyAgICAgICAg
CiAgICAgICAgIHZvaWQgc3RhcnRTd2l0Y2goKSB7IG1fc3dpdGNoRGVwdGgrKzsgfQogICAgICAg
ICB2b2lkIGVuZFN3aXRjaCgpIHsgbV9zd2l0Y2hEZXB0aC0tOyB9CiAgICAgICAgIHZvaWQgc3Rh
cnRMb29wKCkgeyBtX2xvb3BEZXB0aCsrOyB9Cg==
</data>
<flag name="review"
          id="75746"
          type_id="1"
          status="+"
          setter="darin"
    />
          </attachment>
      

    </bug>

</bugzilla>