vty: Avoid use-after-free in VTY telnet interface

If the read callback closes the connection conn is already freed so we
can't derefernce it. Instead return -EBADFD in the read function if it
closed the connection and check for that.
2 files changed