Skip to content

Commit

Permalink
Always close file descriptor after :read command
Browse files Browse the repository at this point in the history
  • Loading branch information
martanne committed Jan 16, 2015
1 parent 3243bce commit 931cf0e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions vis.c
Original file line number Diff line number Diff line change
Expand Up @@ -1567,8 +1567,7 @@ static bool cmd_read(Filerange *range, const char *argv[]) {
text_insert(vis->win->text, pos, data, info.st_size);
pos += info.st_size;
err:
if (fd > 2)
close(fd);
close(fd);
if (data && data != MAP_FAILED)
munmap(data, info.st_size);
}
Expand Down

0 comments on commit 931cf0e

Please sign in to comment.