This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
Harald Welte gerrit-no-reply at lists.osmocom.org
Review at https://gerrit.osmocom.org/1283
telnet_interface: Handle osmo_fd_register() eror return code
Change-Id: I5bc1c2cbb04e363d868355b5ed866b4840f16c61
Fixes: Coverity 57637
---
M src/vty/telnet_interface.c
1 file changed, 6 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/83/1283/1
diff --git a/src/vty/telnet_interface.c b/src/vty/telnet_interface.c
index e86a6b1..218f9ab 100644
--- a/src/vty/telnet_interface.c
+++ b/src/vty/telnet_interface.c
@@ -145,6 +145,7 @@
struct sockaddr_in sockaddr;
socklen_t len = sizeof(sockaddr);
int new_connection = accept(fd->fd, (struct sockaddr*)&sockaddr, &len);
+ int rc;
if (new_connection < 0) {
LOGP(0, LOGL_ERROR, "telnet accept failed\n");
@@ -157,7 +158,11 @@
connection->fd.fd = new_connection;
connection->fd.when = BSC_FD_READ;
connection->fd.cb = client_data;
- osmo_fd_register(&connection->fd);
+ rc = osmo_fd_register(&connection->fd);
+ if (rc < 0) {
+ talloc_free(connection);
+ return rc;
+ }
llist_add_tail(&connection->entry, &active_connections);
connection->vty = vty_create(new_connection, connection);
--
To view, visit https://gerrit.osmocom.org/1283
To unsubscribe, visit https://gerrit.osmocom.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I5bc1c2cbb04e363d868355b5ed866b4840f16c61
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>