Skip to content

Commit

Permalink
fix memory leak on nuttx flat memory model
Browse files Browse the repository at this point in the history
  • Loading branch information
yamt committed Jun 18, 2023
1 parent 4e1b382 commit 4592e75
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions cli/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ main(int argc, char *const *argv)
#endif
default:
print_usage();
exit(0);
goto success;
}
}
argc -= optind;
Expand All @@ -329,15 +329,15 @@ main(int argc, char *const *argv)
if (do_repl) {
ret = toywasm_repl(state);
if (ret != 0) {
exit(1);
goto fail;
}
exit(0);
goto success;
}
if (argc == 0) {
if (might_need_help) {
print_usage();
}
exit(0);
goto success;
}
#if defined(TOYWASM_ENABLE_WASI)
ret = toywasm_repl_set_wasi_args(state, argc, argv);
Expand Down Expand Up @@ -410,4 +410,7 @@ main(int argc, char *const *argv)
#endif
free(state);
exit(exit_status);
success:
exit_status = 0;
goto fail;
}

0 comments on commit 4592e75

Please sign in to comment.