summaryrefslogtreecommitdiff
path: root/win32/file.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-10-17 05:21:38 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-10-17 05:21:38 +0000
commit36862468a80435902ee41c5392d2e3161e5a0281 (patch)
tree2767693d841f184db2946905a44ecc6d83939914 /win32/file.c
parent3f2828078273ec2b92afe27d3b081049bca2bcd2 (diff)
file.c: fix memory leak
* win32/file.c (rb_file_expand_path_internal): fix memory leaks at a non-absolute home exception. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43328 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32/file.c')
-rw-r--r--win32/file.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/win32/file.c b/win32/file.c
index 2122ae13598..444b628e8b6 100644
--- a/win32/file.c
+++ b/win32/file.c
@@ -373,6 +373,7 @@ rb_file_expand_path_internal(VALUE fname, VALUE dname, int abs_mode, int long_na
if (PathIsRelativeW(whome) && !(whome_len >= 2 && IS_DIR_UNC_P(whome))) {
xfree(wpath);
+ xfree(whome);
rb_raise(rb_eArgError, "non-absolute home");
}
@@ -441,6 +442,7 @@ rb_file_expand_path_internal(VALUE fname, VALUE dname, int abs_mode, int long_na
if (PathIsRelativeW(whome) && !(whome_len >= 2 && IS_DIR_UNC_P(whome))) {
xfree(wpath);
xfree(wdir);
+ xfree(whome);
rb_raise(rb_eArgError, "non-absolute home");
}