[前][次][番号順一覧][スレッド一覧]

ruby-changes:38571

From: nobu <ko1@a...>
Date: Wed, 27 May 2015 22:37:00 +0900 (JST)
Subject: [ruby-changes:38571] nobu:r50652 (trunk): tcltklib.c: fix memory leak

nobu	2015-05-27 22:36:27 +0900 (Wed, 27 May 2015)

  New Revision: 50652

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=50652

  Log:
    tcltklib.c: fix memory leak
    
    * ext/tk/tcltklib.c (ip_init): reject already initialized
      interpreter to fix memory leak.

  Modified files:
    trunk/ext/tk/tcltklib.c
Index: ext/tk/tcltklib.c
===================================================================
--- ext/tk/tcltklib.c	(revision 50651)
+++ ext/tk/tcltklib.c	(revision 50652)
@@ -6134,6 +6134,9 @@ ip_init(argc, argv, self) https://github.com/ruby/ruby/blob/trunk/ext/tk/tcltklib.c#L6134
 
     /* create object */
     TypedData_Get_Struct(self, struct tcltkip, &tcltkip_type, ptr);
+    if (DATA_PTR(self)) {
+	rb_raise(rb_eArgError, "already initialized interpreter");
+    }
     ptr = ALLOC(struct tcltkip);
     /* ptr = RbTk_ALLOC_N(struct tcltkip, 1); */
     DATA_PTR(self) = ptr;

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]