mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Merge pull request #4128 from take-cheeze/patch-1
Fix memory leak in `mrb_str_count`
This commit is contained in:
@@ -718,6 +718,7 @@ mrb_str_count(mrb_state *mrb, mrb_value str)
|
||||
|
||||
if (n >= 0) count++;
|
||||
}
|
||||
tr_pattern_free(mrb, pat);
|
||||
return mrb_fixnum_value(count);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user