From 56e69d71092e8bf41b94036f51c3a07575194f74 Mon Sep 17 00:00:00 2001 From: usa Date: Wed, 12 Aug 2009 05:16:56 +0000 Subject: [PATCH] * win32/win32.c (readdir_internal): free old temporary filename. [ruby-core:24820] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24510 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ win32/win32.c | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index ea7d328568..a517a2808a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Wed Aug 12 14:14:42 2009 NAKAMURA Usaku + + * win32/win32.c (readdir_internal): free old temporary filename. + [ruby-core:24820] + Wed Aug 12 12:59:51 2009 Nobuyoshi Nakada * string.c (rb_str_new_frozen): must not change encoding of frozen diff --git a/win32/win32.c b/win32/win32.c index fc33b1152c..1d6a4a68e4 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -1765,6 +1765,8 @@ readdir_internal(DIR *dirp, BOOL (*conv)(const WCHAR *, struct direct *, rb_enco // // first set up the structure to return // + if (dirp->dirstr.d_name) + free(dirp->dirstr.d_name); conv(dirp->curr, &dirp->dirstr, enc); // @@ -3585,8 +3587,8 @@ rb_w32_getcwd(char *buffer, int size) size = len; if (!p) { errno = ENOMEM; - return NULL; - } + return NULL; + } } if (!GetCurrentDirectory(size, p)) {