summaryrefslogtreecommitdiff
path: root/class.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-10-04 12:10:09 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-10-04 12:10:09 +0000
commit92a05ea2cf375e415ddd420243d0e38801708f8a (patch)
tree4f7741ae3ff738482c615ecd8319963ce7e03fb9 /class.c
parent0688c81a89e506f426df8b58cb57a706477bf95c (diff)
downloadruby-92a05ea2cf375e415ddd420243d0e38801708f8a.tar.gz
* class.c (class_alloc): allocate extra memory after containing
object setup to get rid of rare-but-potential memory leak. * gc.c (gc_mark_children): skip marking extended members if ptr is NULL. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33400 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'class.c')
-rw-r--r--class.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/class.c b/class.c
index e6c1f8fd11..b595473333 100644
--- a/class.c
+++ b/class.c
@@ -49,10 +49,9 @@ static ID id_attached;
static VALUE
class_alloc(VALUE flags, VALUE klass)
{
- rb_classext_t *ext = ALLOC(rb_classext_t);
NEWOBJ(obj, struct RClass);
OBJSETUP(obj, klass, flags);
- obj->ptr = ext;
+ obj->ptr = ALLOC(rb_classext_t);
RCLASS_IV_TBL(obj) = 0;
RCLASS_CONST_TBL(obj) = 0;
RCLASS_M_TBL(obj) = 0;