summaryrefslogtreecommitdiff
path: root/hash.c
diff options
context:
space:
mode:
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++;