* dir.c (glob_helper): fix memory leak.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5405 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2004-01-07 13:28:15 +00:00
parent d5ffbb20e8
commit debe0485f0
2 changed files with 13 additions and 7 deletions

View File

@ -1,3 +1,7 @@
Wed Jan 7 22:28:12 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* dir.c (glob_helper): fix memory leak.
Wed Jan 7 21:15:07 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
* sample/webrick/*: new files.

4
dir.c
View File

@ -203,6 +203,7 @@ fnmatch(pat, string, flags)
INC_S();
++pat;
break;
case '*':
while ((c = *++pat) == '*')
;
@ -261,7 +262,7 @@ fnmatch(pat, string, flags)
;
else
#endif
if(Compare(pat, s) != 0)
if (Compare(pat, s) != 0)
return FNM_NOMATCH;
INC_S();
Inc(pat);
@ -1129,6 +1130,7 @@ glob_helper(path, sub, separator, flags, func, arg) /* if separator p[-1] is rem
strcpy(buf+n1, link->name);
strcpy(buf+n2, m);
status = glob_helper(buf, buf+n2+1, 1, flags, func, arg);
free(buf);
}
tmp = link;
link = link->next;