Unverified Commit 47413d05 authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto Committed by GitHub

Merge pull request #4046 from kou/fix-wrong-free-function

Fix wrong free function
parents a9abf65f fb935820
...@@ -599,13 +599,13 @@ done: ...@@ -599,13 +599,13 @@ done:
/* warning */ /* warning */
char* msg = mrb_locale_from_utf8(parser->warn_buffer[0].message, -1); char* msg = mrb_locale_from_utf8(parser->warn_buffer[0].message, -1);
printf("line %d: %s\n", parser->warn_buffer[0].lineno, msg); printf("line %d: %s\n", parser->warn_buffer[0].lineno, msg);
mrb_utf8_free(msg); mrb_locale_free(msg);
} }
if (0 < parser->nerr) { if (0 < parser->nerr) {
/* syntax error */ /* syntax error */
char* msg = mrb_locale_from_utf8(parser->error_buffer[0].message, -1); char* msg = mrb_locale_from_utf8(parser->error_buffer[0].message, -1);
printf("line %d: %s\n", parser->error_buffer[0].lineno, msg); printf("line %d: %s\n", parser->error_buffer[0].lineno, msg);
mrb_utf8_free(msg); mrb_locale_free(msg);
} }
else { else {
/* generate bytecode */ /* generate bytecode */
......
...@@ -310,7 +310,7 @@ mrb_file__gethome(mrb_state *mrb, mrb_value klass) ...@@ -310,7 +310,7 @@ mrb_file__gethome(mrb_state *mrb, mrb_value klass)
} }
home = mrb_locale_from_utf8(home, -1); home = mrb_locale_from_utf8(home, -1);
path = mrb_str_new_cstr(mrb, home); path = mrb_str_new_cstr(mrb, home);
mrb_utf8_free(home); mrb_locale_free(home);
return path; return path;
#else #else
argc = mrb_get_argc(mrb); argc = mrb_get_argc(mrb);
...@@ -327,7 +327,7 @@ mrb_file__gethome(mrb_state *mrb, mrb_value klass) ...@@ -327,7 +327,7 @@ mrb_file__gethome(mrb_state *mrb, mrb_value klass)
} }
home = mrb_locale_from_utf8(home, -1); home = mrb_locale_from_utf8(home, -1);
path = mrb_str_new_cstr(mrb, home); path = mrb_str_new_cstr(mrb, home);
mrb_utf8_free(home); mrb_locale_free(home);
return path; return path;
#endif #endif
} }
......
...@@ -780,7 +780,7 @@ reopen: ...@@ -780,7 +780,7 @@ reopen:
mrb_str_modify(mrb, mrb_str_ptr(emsg)); mrb_str_modify(mrb, mrb_str_ptr(emsg));
mrb_sys_fail(mrb, RSTRING_PTR(emsg)); mrb_sys_fail(mrb, RSTRING_PTR(emsg));
} }
mrb_utf8_free(fname); mrb_locale_free(fname);
if (fd <= 2) { if (fd <= 2) {
mrb_fd_cloexec(mrb, fd); mrb_fd_cloexec(mrb, fd);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment