mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Fix memory leak in Kernel#eval
The `mrbc_context` remained unreleased when the `mrb_parse_nstring()` function returned `NULL`.
This commit is contained in:
@@ -65,6 +65,7 @@ create_proc_from_string(mrb_state *mrb, const char *s, mrb_int len, mrb_value bi
|
||||
|
||||
/* only occur when memory ran out */
|
||||
if (!p) {
|
||||
mrbc_context_free(mrb, cxt);
|
||||
mrb_raise(mrb, E_RUNTIME_ERROR, "Failed to create parser state (out of memory)");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user