From e8e4322bc91ba8e2591d128dce01b00406dc0aa2 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sun, 21 Oct 2018 13:22:31 +0200 Subject: telnet_interface: avoid double-close of fd() Change-Id: Ibd81f29fa22d53553bd73c055d6a1f5255a69bad Fixes: Coverity CID#135238 --- src/vty/telnet_interface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vty/telnet_interface.c b/src/vty/telnet_interface.c index 0ccf8dc6..fdd88c1f 100644 --- a/src/vty/telnet_interface.c +++ b/src/vty/telnet_interface.c @@ -177,7 +177,7 @@ static int telnet_new_connection(struct osmo_fd *fd, unsigned int what) connection->vty = vty_create(new_connection, connection); if (!connection->vty) { LOGP(0, LOGL_ERROR, "couldn't create VTY\n"); - close(new_connection); + /* vty_create() is already closing the fd if it returns NULL */ talloc_free(connection); return -1; } -- cgit v1.2.3