diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c index d6028a237..af9ae9990 100644 --- a/src/libosmo-mgcp/mgcp_network.c +++ b/src/libosmo-mgcp/mgcp_network.c @@ -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); } }