mgcp_network: Unregister osmo_fd before closing fd

(cherry picked from commit 6c303664f5)

Change-Id: I2f58dc825de1604fb464858c9cb3b87d029cb4ad
This commit is contained in:
Pau Espin 2023-03-09 18:34:12 +01:00
parent cfef36837e
commit fffe261076
1 changed files with 2 additions and 2 deletions

View File

@ -1668,14 +1668,14 @@ int mgcp_bind_net_rtp_port(struct mgcp_endpoint *endp, int rtp_port,
void mgcp_free_rtp_port(struct mgcp_rtp_end *end)
{
if (end->rtp.fd != -1) {
osmo_fd_unregister(&end->rtp);
close(end->rtp.fd);
end->rtp.fd = -1;
osmo_fd_unregister(&end->rtp);
}
if (end->rtcp.fd != -1) {
osmo_fd_unregister(&end->rtcp);
close(end->rtcp.fd);
end->rtcp.fd = -1;
osmo_fd_unregister(&end->rtcp);
}
}