Need to mark shared env objects as `MRB_TT_FREE`; fix #4143

The following code mistakenly exits from the function without marking
the env object as `MRB_TT_FREE`.

``` ruby
      if (MRB_ENV_STACK_SHARED_P(e)) {
        /* cannot be freed */
        return; // <- should be `break`
      }
```
parent 7ff84789
......@@ -788,7 +788,8 @@ obj_free(mrb_state *mrb, struct RBasic *obj, int end)
if (MRB_ENV_STACK_SHARED_P(e)) {
/* cannot be freed */
return;
e->stack = NULL;
break;
}
mrb_free(mrb, e->stack);
e->stack = NULL;
......
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