mgcp_network: Unregister osmo_fd before closing fd

Change-Id: Ib937e56be62327f52d9cf03a07d7620080356ee8
This commit is contained in:
Pau Espin 2023-03-09 18:34:12 +01:00
parent 544016d8e6
commit 6c303664f5
1 changed files with 2 additions and 2 deletions

View File

@ -1676,14 +1676,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);
}
}