# HG changeset patch # User Mychaela Falconia # Date 1678596083 28800 # Node ID 565477d07418bfd13cb7ff10a41d196660c7551f # Parent b79d6334f5437a09a68d84ab4504fa9d0b096bdf themwi-rtp-mgr: close file descriptors after sending them across diff -r b79d6334f543 -r 565477d07418 rtp-mgr/ctrl_prot.c --- a/rtp-mgr/ctrl_prot.c Sat Mar 11 20:19:14 2023 -0800 +++ b/rtp-mgr/ctrl_prot.c Sat Mar 11 20:41:23 2023 -0800 @@ -20,7 +20,7 @@ extern struct bind_range_cfg bind_range_gsm, bind_range_pstn; -void +static void free_rtp_end(roe) struct rtp_one_end *roe; { @@ -28,6 +28,16 @@ close(roe->rtcp_fd); } +static void +close_fds(fd_list, num_fd) + int *fd_list, num_fd; +{ + int i; + + for (i = 0; i < num_fd; i++) + close(fd_list[i]); +} + void ctrl_message_handler(fd) { @@ -127,4 +137,5 @@ fd_bufptr = (int *) CMSG_DATA(cmsg); bcopy(fd_out, fd_bufptr, sizeof(int) * num_fd); sendmsg(fd, &msg, 0); + close_fds(fd_out, num_fd); }