зеркало из https://github.com/github/ruby.git
file.c: fix mem leak in rb_stat_init
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2756 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
8790d9b76e
Коммит
29966e099c
|
@ -1,3 +1,7 @@
|
|||
Wed Aug 28 18:19:55 2002 Michal Rokos <michal@ruby-lang.org>
|
||||
|
||||
* file.c: fix memory leak in rb_stat_init.
|
||||
|
||||
Wed Aug 28 17:45:03 2002 Nobuyoshi Nakada <nobu.nokada@softhome.net>
|
||||
|
||||
* win32/win32.c (kill): negate pid under Win9x.
|
||||
|
@ -20,7 +24,6 @@ Wed Aug 28 15:00:29 2002 Yukihiro Matsumoto <matz@ruby-lang.org>
|
|||
|
||||
* string.c (rb_str_intern): ditto.
|
||||
|
||||
>>>>>>> 1.1095
|
||||
Wed Aug 28 11:37:35 2002 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||
|
||||
* win32/win32.h: define SIGINT and SIGKILL if not defined.
|
||||
|
|
4
file.c
4
file.c
|
@ -2009,6 +2009,10 @@ rb_stat_init(obj, fname)
|
|||
if (stat(RSTRING(fname)->ptr, &st) == -1) {
|
||||
rb_sys_fail(RSTRING(fname)->ptr);
|
||||
}
|
||||
if (DATA_PTR(obj)) {
|
||||
free(DATA_PTR(obj));
|
||||
DATA_PTR(obj) = NULL;
|
||||
}
|
||||
nst = ALLOC(struct stat);
|
||||
*nst = st;
|
||||
DATA_PTR(obj) = nst;
|
||||
|
|
Загрузка…
Ссылка в новой задаче