1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

tcltklib.c: fix memory leak

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

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50652 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2015-05-27 13:36:27 +00:00
parent 19341b86be
commit c83883cf4e

View file

@ -6134,6 +6134,9 @@ ip_init(argc, argv, self)
/* 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;