diff --git a/ChangeLog b/ChangeLog index 77153b1eab..3ebd2bf88e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Thu Sep 12 17:45:15 2002 Nobuyoshi Nakada + + * dir.c (glob_helper): fixed freeing buffer. (ruby-bugs-ja:PR#332) + Thu Sep 12 00:09:32 2002 Nobuyoshi Nakada * eval.c (rb_trap_eval): preserve thread status and so on. diff --git a/dir.c b/dir.c index 72ce949b24..72f5fd3cd1 100644 --- a/dir.c +++ b/dir.c @@ -787,6 +787,7 @@ glob_helper(path, sub, flags, func, arg) status = glob_helper(buf, t, flags, func, arg); free(buf); if (status) goto finalize; + continue; } free(buf); continue; @@ -796,6 +797,7 @@ glob_helper(path, sub, flags, func, arg) sprintf(buf, "%s%s%s", base, (BASE) ? "/" : "", dp->d_name); if (!m) { status = glob_call_func(func, path, arg); + free(buf); if (status) goto finalize; continue; }