1 --- a/networking/inetd.c
2 +++ b/networking/inetd.c
3 @@ -1278,6 +1278,7 @@ int inetd_main(int argc UNUSED_PARAM, ch
5 rearm_alarm(); /* will revive it in RETRYTIME sec */
6 restore_sigmask(&omask);
7 + maybe_close(new_udp_fd);
8 maybe_close(accepted_fd);
9 continue; /* -> check next fd in fd set */
11 @@ -1298,17 +1299,18 @@ int inetd_main(int argc UNUSED_PARAM, ch
12 bb_perror_msg("vfork"+1);
14 restore_sigmask(&omask);
15 + maybe_close(new_udp_fd);
16 maybe_close(accepted_fd);
17 continue; /* -> check next fd in fd set */
20 pid--; /* -1: "we did fork and we are child" */
22 - /* if pid == 0 here, we never forked */
23 + /* if pid == 0 here, we didn't fork */
25 if (pid > 0) { /* parent */
27 - /* tcp wait: we passed listening socket to child,
28 + /* wait: we passed socket to child,
29 * will wait for child to terminate */
31 remove_fd_from_set(sep->se_fd);
32 @@ -1345,9 +1347,13 @@ int inetd_main(int argc UNUSED_PARAM, ch
35 if (new_udp_fd >= 0) {
36 - len_and_sockaddr *lsa = xzalloc_lsa(sep->se_family);
37 + len_and_sockaddr *lsa;
41 + lsa = xzalloc_lsa(sep->se_family);
42 /* peek at the packet and remember peer addr */
43 - int r = recvfrom(ctrl, NULL, 0, MSG_PEEK|MSG_DONTWAIT,
44 + r = recvfrom(ctrl, NULL, 0, MSG_PEEK|MSG_DONTWAIT,
45 &lsa->u.sa, &lsa->len);