diff --git a/ChangeLog b/ChangeLog index 97b5e74880..5127e2e05b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Tue Aug 31 18:20:49 2004 Hirokazu Yamamoto + + * 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 * ext/tcltklib/tcltklib.c (ip_delete): when a tcltkip is deleted, diff --git a/ext/tk/tkutil.c b/ext/tk/tkutil.c index 37af36b049..b3e79430dd 100644 --- a/ext/tk/tkutil.c +++ b/ext/tk/tkutil.c @@ -938,7 +938,6 @@ cbsubst_init() inf->size = 0; - inf->key = ALLOC_N(char, 1); inf->key = ALLOC_N(char, 1); inf->key[0] = '\0'; @@ -1028,7 +1027,7 @@ cbsubst_get_all_subst_keys(self) struct cbsubst_info, inf); len = strlen(inf->key); - buf = ALLOC_N(char, 3*len); + buf = ALLOC_N(char, 3*len + 1); ptr = buf; for(i = 0; i < len; i++) { *(ptr++) = '%';