Skip to content

Commit

Permalink
ui: fix resource leak, close file descriptor
Browse files Browse the repository at this point in the history
  • Loading branch information
martanne committed Oct 5, 2016
1 parent 3a6e37c commit e3c1f30
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions ui-curses.c
Original file line number Diff line number Diff line change
Expand Up @@ -1105,6 +1105,7 @@ static const char *ui_getkey(Ui *ui) {
goto fatal;
if (tty != STDIN_FILENO && dup2(tty, STDIN_FILENO) == -1)
goto fatal;
close(tty);
termkey_destroy(uic->termkey);
if (!(uic->termkey = ui_termkey_new(STDIN_FILENO)))
goto fatal;
Expand Down

0 comments on commit e3c1f30

Please sign in to comment.