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

* ext/tk/tkutil.c (cbsubst_init): fix memory leak

* ext/tk/tkutil.c (cbsubst_get_all_subst_keys): fix SEGV


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6843 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ocean 2004-08-31 09:24:36 +00:00
parent 24053adc1e
commit 3fb0d33b19
2 changed files with 7 additions and 2 deletions

View file

@ -1,3 +1,9 @@
Tue Aug 31 18:20:49 2004 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* ext/tk/tkutil.c (cbsubst_init): fix memory leak
* ext/tk/tkutil.c (cbsubst_get_all_subst_keys): fix SEGV
Tue Aug 31 16:04:22 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp> Tue Aug 31 16:04:22 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tcltklib/tcltklib.c (ip_delete): when a tcltkip is deleted, * ext/tcltklib/tcltklib.c (ip_delete): when a tcltkip is deleted,

View file

@ -938,7 +938,6 @@ cbsubst_init()
inf->size = 0; inf->size = 0;
inf->key = ALLOC_N(char, 1);
inf->key = ALLOC_N(char, 1); inf->key = ALLOC_N(char, 1);
inf->key[0] = '\0'; inf->key[0] = '\0';
@ -1028,7 +1027,7 @@ cbsubst_get_all_subst_keys(self)
struct cbsubst_info, inf); struct cbsubst_info, inf);
len = strlen(inf->key); len = strlen(inf->key);
buf = ALLOC_N(char, 3*len); buf = ALLOC_N(char, 3*len + 1);
ptr = buf; ptr = buf;
for(i = 0; i < len; i++) { for(i = 0; i < len; i++) {
*(ptr++) = '%'; *(ptr++) = '%';