summaryrefslogtreecommitdiffstats
path: root/win32
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-08-12 05:16:56 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-08-12 05:16:56 +0000
commitb8b3a82d903272ad6ff12770c25ed1799608eda4 (patch)
tree110b9a65f5ddf6983d9a245bb91a72fce2c687f6 /win32
parent9a76c3e9a7bc78af3cf9133a08f57d77e95131f7 (diff)
downloadruby-b8b3a82d903272ad6ff12770c25ed1799608eda4.tar.gz
ruby-b8b3a82d903272ad6ff12770c25ed1799608eda4.tar.xz
ruby-b8b3a82d903272ad6ff12770c25ed1799608eda4.zip
* win32/win32.c (readdir_internal): free old temporary filename.
[ruby-core:24820] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24510 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32')
-rw-r--r--win32/win32.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/win32/win32.c b/win32/win32.c
index fc33b1152..1d6a4a68e 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)) {