summaryrefslogtreecommitdiffstats
path: root/hash.c
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-02-05 15:25:35 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-02-05 15:25:35 +0000
commit84a28f7dd63968a68d8a758fc0df935b046b7698 (patch)
tree289d5d0389e0ab1e7381d1c45869de55092e10b9 /hash.c
parent7bce79a21c93f6dc32d4f92d6d7584732bf49acf (diff)
downloadruby-84a28f7dd63968a68d8a758fc0df935b046b7698.tar.gz
ruby-84a28f7dd63968a68d8a758fc0df935b046b7698.tar.xz
ruby-84a28f7dd63968a68d8a758fc0df935b046b7698.zip
* hash.c (env_rassoc): remove access to free'd environment on mswin32.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15379 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/hash.c b/hash.c
index 707f8a676..0328d9d1a 100644
--- a/hash.c
+++ b/hash.c
@@ -2372,8 +2372,9 @@ env_rassoc(VALUE dmy, VALUE obj)
if (s++) {
long len = strlen(s);
if (RSTRING_LEN(obj) == len && strncmp(s, RSTRING_PTR(obj), len) == 0) {
+ VALUE result = rb_assoc_new(rb_tainted_str_new(*env, s-*env-1), obj);
FREE_ENVIRON(environ);
- return rb_assoc_new(rb_tainted_str_new(*env, s-*env-1), obj);
+ return result;
}
}
env++;