From 4c518b8c82ee8875d81cbe22bdec37714b3d288a Mon Sep 17 00:00:00 2001 From: Alejandro Leal Conejos Date: Tue, 26 Oct 2021 16:27:28 +0200 Subject: [PATCH] Fixes coverity 373325 --- srsepc/src/mme/s1ap.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/srsepc/src/mme/s1ap.cc b/srsepc/src/mme/s1ap.cc index 9b901ddf8..9917c6583 100644 --- a/srsepc/src/mme/s1ap.cc +++ b/srsepc/src/mme/s1ap.cc @@ -165,10 +165,12 @@ int s1ap::enb_listen() // S1-MME bind bzero(&s1mme_addr, sizeof(s1mme_addr)); if (not srsran::net_utils::set_sockaddr(&s1mme_addr, m_s1ap_args.mme_bind_addr.c_str(), S1MME_PORT)) { + close(sock_fd); m_logger.error("Invalid mme_bind_addr: %s", m_s1ap_args.mme_bind_addr.c_str()); srsran::console("Invalid mme_bind_addr: %s\n", m_s1ap_args.mme_bind_addr.c_str()); return SRSRAN_ERROR; } + if (not srsran::net_utils::bind_addr(sock_fd, s1mme_addr)) { close(sock_fd); m_logger.error("Error binding SCTP socket");