<?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>27211</bug_id>
          
          <creation_ts>2009-07-13 04:58:53 -0700</creation_ts>
          <short_desc>fastMalloc and fastFree mismatch correction</short_desc>
          <delta_ts>2009-08-24 10:55:41 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebCore Misc.</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>25930</dup_id>
          
          <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>0</everconfirmed>
          <reporter name="Zoltan Horvath">zoltan</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>darin</cc>
    
    <cc>kbalazs</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>131297</commentid>
    <comment_count>0</comment_count>
    <who name="Zoltan Horvath">zoltan</who>
    <bug_when>2009-07-13 04:58:53 -0700</bug_when>
    <thetext>An array in CSSSelectorList.cpp has been allocated with fastMalloc and freed with delete instead of fastFree.

fastFree should be called to match fastMalloc and fastFree. (It is very important for custom allocation framework.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>131298</commentid>
    <comment_count>1</comment_count>
      <attachid>32657</attachid>
    <who name="Zoltan Horvath">zoltan</who>
    <bug_when>2009-07-13 05:04:12 -0700</bug_when>
    <thetext>Created attachment 32657
proposed patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>131345</commentid>
    <comment_count>2</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2009-07-13 10:31:15 -0700</bug_when>
    <thetext>There’s been a lot of back and forth about this in another bug. This is not the correct fix -- it&apos;s hard to find the correct fix. I&apos;ll have to find the other bug for you.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>131346</commentid>
    <comment_count>3</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2009-07-13 10:31:51 -0700</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 25930 ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>142307</commentid>
    <comment_count>4</comment_count>
    <who name="Balazs Kelemen">kbalazs</who>
    <bug_when>2009-08-24 07:27:51 -0700</bug_when>
    <thetext>I think there is no problem freeing with fastFree here, since Vector allocates it&apos;s storage with fastMalloc. What have I missed?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>142331</commentid>
    <comment_count>5</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2009-08-24 10:55:41 -0700</bug_when>
    <thetext>(In reply to comment #4)
&gt; I think there is no problem freeing with fastFree here, since Vector allocates
&gt; it&apos;s storage with fastMalloc. What have I missed?

How Vector allocates its storage is irrelevant, since is not the vector storage being freed. The vector storage is a pointer in selectorVector.m_buffer.m_buffer.

What&apos;s being freed here is selectorVector[i]. If you trace the flow of the code back you&apos;ll see that it&apos;s a CSSSelector object that was allocated by the CSSParser::createFloatingSelector function.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>32657</attachid>
            <date>2009-07-13 05:04:12 -0700</date>
            <delta_ts>2009-07-13 10:32:02 -0700</delta_ts>
            <desc>proposed patch</desc>
            <filename>CSSSelectorList.patch</filename>
            <type>text/plain</type>
            <size>1843</size>
            <attacher name="Zoltan Horvath">zoltan</attacher>
            
              <data encoding="base64">SW5kZXg6IFdlYkNvc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Y2hhcio+KHNlbGVjdG9yVmVjdG9yW2ld
KTsKKyAgICAgICAgZmFzdEZyZWUocmVpbnRlcnByZXRfY2FzdDxjaGFyKj4oc2VsZWN0b3JWZWN0
b3JbaV0pKTsKICAgICAgICAgQVNTRVJUKCFtX3NlbGVjdG9yQXJyYXlbaV0uaXNMYXN0SW5TZWxl
Y3Rvckxpc3QoKSk7CiAgICAgfQogICAgIG1fc2VsZWN0b3JBcnJheVtzaXplIC0gMV0uc2V0TGFz
dEluU2VsZWN0b3JMaXN0KCk7Cg==
</data>
<flag name="review"
          id="17052"
          type_id="1"
          status="-"
          setter="darin"
    />
          </attachment>
      

    </bug>

</bugzilla>