From 36862468a80435902ee41c5392d2e3161e5a0281 Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 17 Oct 2013 05:21:38 +0000 Subject: 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 --- win32/file.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'win32') diff --git a/win32/file.c b/win32/file.c index 2122ae1359..444b628e8b 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"); } -- cgit v1.2.3