Fix memory leaks in mirb.

parent 5e7ced07
...@@ -661,6 +661,12 @@ done: ...@@ -661,6 +661,12 @@ done:
if (args.rfp) fclose(args.rfp); if (args.rfp) fclose(args.rfp);
mrb_free(mrb, args.argv); mrb_free(mrb, args.argv);
if (args.libv) {
for (i = 0; i < args.libc; ++i) {
mrb_free(mrb, args.libv[i]);
}
mrb_free(mrb, args.libv);
}
mrbc_context_free(mrb, cxt); mrbc_context_free(mrb, cxt);
mrb_close(mrb); mrb_close(mrb);
......
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