mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Merge pull request #5842 from mattn/fix-use-after-free
fix use after free
This commit is contained in:
@@ -261,7 +261,7 @@ mrb_file_realpath(mrb_state *mrb, mrb_value klass)
|
||||
result = mrb_str_new_capa(mrb, PATH_MAX);
|
||||
if (realpath(cpath, RSTRING_PTR(result)) == NULL) {
|
||||
mrb_locale_free(cpath);
|
||||
mrb_sys_fail(mrb, cpath);
|
||||
mrb_sys_fail(mrb, RSTRING_CSTR(mrb, pathname));
|
||||
return result; /* not reached */
|
||||
}
|
||||
mrb_locale_free(cpath);
|
||||
|
||||
Reference in New Issue
Block a user