vty.c: Set vty->fd to -1 after closing the FD

Change-Id: I07d105f4a810dd809fbf6feb5c04e7410020c887
This commit is contained in:
Harald Welte 2018-10-21 13:22:52 +02:00
parent e8e4322bc9
commit 2e0a945d3d
1 changed files with 3 additions and 1 deletions

View File

@ -221,8 +221,10 @@ void vty_close(struct vty *vty)
vector_unset(vtyvec, vty->fd);
/* Close socket. */
if (vty->fd > 0)
if (vty->fd > 0) {
close(vty->fd);
vty->fd = -1;
}
if (vty->buf) {
talloc_free(vty->buf);