aboutsummaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'file.c')
-rw-r--r--file.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/file.c b/file.c
index 34b2693430..f6271a3607 100644
--- a/file.c
+++ b/file.c
@@ -5609,6 +5609,7 @@ rb_find_file_ext_safe(VALUE *filep, const char *const *ext, int safe_level)
}
rb_str_set_len(fname, fnlen);
}
+ rb_str_resize(tmp, 0);
RB_GC_GUARD(load_path);
return 0;
}
@@ -5661,6 +5662,7 @@ rb_find_file_safe(VALUE path, int safe_level)
if (rb_file_load_ok(f)) goto found;
}
}
+ rb_str_resize(tmp, 0);
return 0;
}
else {