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:
Yukihiro "Matz" Matsumoto
2015-07-16 21:55:27 +09:00
3 changed files with 5 additions and 11 deletions
+1 -2
View File
@@ -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);
}
+2 -3
View File
@@ -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
View File
@@ -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;
}