summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2018-10-21 13:22:31 +0200
committerHarald Welte <laforge@gnumonks.org>2018-10-21 13:46:07 +0200
commite8e4322bc91ba8e2591d128dce01b00406dc0aa2 (patch)
treea65eb89c53936ad15fcfce08afddc6b004dfdea8
parent37608f911d6d046c968795e051f2ead8d04e58c0 (diff)
telnet_interface: avoid double-close of fd()
Change-Id: Ibd81f29fa22d53553bd73c055d6a1f5255a69bad Fixes: Coverity CID#135238
-rw-r--r--src/vty/telnet_interface.c2
1 files changed, 1 insertions, 1 deletions
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;
}