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.orgHarald Welte has submitted this change and it was merged.
Change subject: osmo_rtp_socket_fdreg(): Check return value of osmo_fd_register()
......................................................................
osmo_rtp_socket_fdreg(): Check return value of osmo_fd_register()
Change-Id: I4969e0a9e7109d426066e6c2b80ed44c396b65b5
Fixes: Coverity CID 57631
---
M src/trau/osmo_ortp.c
1 file changed, 11 insertions(+), 2 deletions(-)
Approvals:
Harald Welte: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/src/trau/osmo_ortp.c b/src/trau/osmo_ortp.c
index e7c6fc4..51829d1 100644
--- a/src/trau/osmo_ortp.c
+++ b/src/trau/osmo_ortp.c
@@ -211,6 +211,8 @@
static int osmo_rtp_socket_fdreg(struct osmo_rtp_socket *rs)
{
+ int rc;
+
rs->rtp_bfd.fd = rtp_session_get_rtp_socket(rs->sess);
rs->rtcp_bfd.fd = rtp_session_get_rtcp_socket(rs->sess);
rs->rtp_bfd.when = rs->rtcp_bfd.when = BSC_FD_READ;
@@ -218,8 +220,15 @@
rs->rtp_bfd.cb = osmo_rtp_fd_cb;
rs->rtcp_bfd.cb = osmo_rtcp_fd_cb;
- osmo_fd_register(&rs->rtp_bfd);
- osmo_fd_register(&rs->rtcp_bfd);
+ rc = osmo_fd_register(&rs->rtp_bfd);
+ if (rc < 0)
+ return rc;
+
+ rc = osmo_fd_register(&rs->rtcp_bfd);
+ if (rc < 0) {
+ osmo_fd_unregister(&rs->rtp_bfd);
+ return rc;
+ }
return 0;
}
--
To view, visit https://gerrit.osmocom.org/1285
To unsubscribe, visit https://gerrit.osmocom.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I4969e0a9e7109d426066e6c2b80ed44c396b65b5
Gerrit-PatchSet: 1
Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder