summaryrefslogtreecommitdiff
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
commita73ec67e8d016b16b670234d47b0b0fc7a9b1d6d (patch)
tree289d5d0389e0ab1e7381d1c45869de55092e10b9 /hash.c
parent03a4a0f1d2d0bdc7ff2fdedce2f5e67ae5cefdc9 (diff)
* hash.c (env_rassoc): remove access to free'd environment on mswin32.
git-svn-id: svn+ssh://ci.ruby-lang.org/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 707f8a676f..0328d9d1aa 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++;