mgcp-client: Call osmo_fd_unregister() before closing and changing bfd->fd

Change-Id: I95fbcc21a18cadd2c06608cc39b9fe8e12c8bccf
This commit is contained in:
Pau Espin 2023-03-14 11:48:27 +01:00
parent e1da8c9d2c
commit 747fbce4ce
1 changed files with 2 additions and 2 deletions

View File

@ -907,10 +907,10 @@ void mgcp_client_disconnect(struct mgcp_client *mgcp)
wq = &mgcp->wq;
osmo_wqueue_clear(wq);
LOGPMGW(mgcp, LOGL_INFO, "MGCP association: %s -- closed!\n", osmo_sock_get_name2(wq->bfd.fd));
close(wq->bfd.fd);
wq->bfd.fd = -1;
if (osmo_fd_is_registered(&wq->bfd))
osmo_fd_unregister(&wq->bfd);
close(wq->bfd.fd);
wq->bfd.fd = -1;
}
/*! Get the IP-Aaddress of the associated MGW as string.