diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-05-27 13:36:27 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-05-27 13:36:27 +0000 |
commit | 151c80f40aff75da15475b4020699f7302f66387 (patch) | |
tree | 877a24719b57ef64bf261b5bd43ef01a3a5d576e /ext/tk | |
parent | e6de0acd48d15b558f257e69d94f5decb53cde0d (diff) | |
download | ruby-151c80f40aff75da15475b4020699f7302f66387.tar.gz |
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
Diffstat (limited to 'ext/tk')
-rw-r--r-- | ext/tk/tcltklib.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/ext/tk/tcltklib.c b/ext/tk/tcltklib.c index 4a1d3b8317..40d546ea9d 100644 --- a/ext/tk/tcltklib.c +++ b/ext/tk/tcltklib.c @@ -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; |