mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Merge pull request #2888 from cremno/delete-non-nullptr-checks-before-mrb_free()-calls
delete mrb_free()-related non-NULL checks
This commit is contained in:
@@ -161,8 +161,7 @@ parse_args(mrb_state *mrb, int argc, char **argv, struct mrbc_args *args)
|
||||
static void
|
||||
cleanup(mrb_state *mrb, struct mrbc_args *args)
|
||||
{
|
||||
if (args->outfile)
|
||||
mrb_free(mrb, (void*)args->outfile);
|
||||
mrb_free(mrb, (void*)args->outfile);
|
||||
mrb_close(mrb);
|
||||
}
|
||||
|
||||
|
||||
@@ -159,10 +159,9 @@ cleanup(mrb_state *mrb, struct _args *args)
|
||||
{
|
||||
if (args->rfp && args->rfp != stdin)
|
||||
fclose(args->rfp);
|
||||
if (args->cmdline && !args->fname)
|
||||
if (!args->fname)
|
||||
mrb_free(mrb, args->cmdline);
|
||||
if (args->argv)
|
||||
mrb_free(mrb, args->argv);
|
||||
mrb_free(mrb, args->argv);
|
||||
mrb_close(mrb);
|
||||
}
|
||||
|
||||
|
||||
+2
-6
@@ -978,12 +978,8 @@ error_exit:
|
||||
mrb_free(mrb, *bin);
|
||||
*bin = NULL;
|
||||
}
|
||||
if (lv_syms) {
|
||||
mrb_free(mrb, lv_syms);
|
||||
}
|
||||
if (filenames) {
|
||||
mrb_free(mrb, filenames);
|
||||
}
|
||||
mrb_free(mrb, lv_syms);
|
||||
mrb_free(mrb, filenames);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user