Skip to content

Commit

Permalink
apps/system/vi: Add missing vi_release before exit.
Browse files Browse the repository at this point in the history
If VI exit without vi_release, that broken console.

Signed-off-by: Leo Chung <gewalalb@gmail.com>
  • Loading branch information
bl4kraven authored and acassis committed Oct 28, 2024
1 parent c0e04b0 commit c7a905e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions system/vi/vi.c
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,7 @@ static void vi_write(FAR struct vi_s *vi, FAR const char *buffer,
{
fprintf(stderr, "ERROR: write to stdout failed: %d\n",
errcode);
vi_release(vi);
exit(EXIT_FAILURE);
}
}
Expand Down Expand Up @@ -635,6 +636,7 @@ static int vi_getch(FAR struct vi_s *vi)
{
fprintf(stderr, "ERROR: read from stdin failed: %d\n",
errcode);
vi_release(vi);
exit(EXIT_FAILURE);
}
}
Expand Down

0 comments on commit c7a905e

Please sign in to comment.