Leak of mallocs under StructureSet::OutOfLineList::create
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 20 Sep 2014 03:01:44 +0000 (03:01 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 20 Sep 2014 03:01:44 +0000 (03:01 +0000)
https://bugs.webkit.org/show_bug.cgi?id=136970

Reviewed by Filip Pizlo.

addOutOfLine should free the old list when expanding the capacity.

* bytecode/StructureSet.cpp:
(JSC::StructureSet::addOutOfLine):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@173787 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/bytecode/StructureSet.cpp

index 7af3efd851ed58f2f207803dd6dbf339bb97d4bd..1f44f06e6b8e2e40a813236a91eef30146b6aff3 100644 (file)
@@ -1,3 +1,15 @@
+2014-09-19  Ryosuke Niwa  <rniwa@webkit.org>
+
+        Leak of mallocs under StructureSet::OutOfLineList::create
+        https://bugs.webkit.org/show_bug.cgi?id=136970
+
+        Reviewed by Filip Pizlo.
+
+        addOutOfLine should free the old list when expanding the capacity.
+
+        * bytecode/StructureSet.cpp:
+        (JSC::StructureSet::addOutOfLine):
+
 2014-09-19  Daniel Bates  <dabates@apple.com>
 
         Always assume internal SDK when building configuration Production
index 3d176a3a822fdbee26d797bc6d0a886ed1a5c2b0..3d2c1099727602d3eb24def72be0197edd446ac2 100644 (file)
@@ -357,6 +357,7 @@ bool StructureSet::addOutOfLine(Structure* structure)
     for (unsigned i = list->m_length; i--;)
         newList->list()[i] = list->list()[i];
     newList->list()[list->m_length] = structure;
+    OutOfLineList::destroy(list);
     set(newList);
     return true;
 }