pty_on_exit: Fix bug: reference a freed pointer

The result is that the server session cannot be released.

Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
This commit is contained in:
Jianhui Zhao
2020-04-04 17:12:57 +08:00
parent cc29a56559
commit 22ec200d7c
+2 -2
View File
@@ -130,12 +130,12 @@ static void pty_on_exit(struct ev_loop *loop, struct ev_child *w, int revents)
struct rtty *rtty = tty->rtty;
struct buffer *wb = &rtty->wb;
del_tty(tty);
buffer_put_u8(wb, MSG_TYPE_LOGOUT);
buffer_put_u16be(wb, 1);
buffer_put_u8(wb, tty->sid);
ev_io_start(loop, &rtty->iow);
del_tty(tty);
}
static void tty_login(struct rtty *rtty)