summaryrefslogtreecommitdiff
path: root/class.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-10-04 06:04:46 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-10-04 06:04:46 +0000
commitbf8168cf334e45ce6e93fa5aedc74ab7ca4069f3 (patch)
treeaed1ade8f5d7f75be921a1c27a092bfc431ef078 /class.c
parente6c2da74e6e6aea10035df83ac77fbb21a75b4f4 (diff)
* class.c (class_alloc): allocate extra memory after containing
object setup to get rid of rare-but-potential memory leak. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33397 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;