diff --git a/src/util-io.c b/src/util-io.c index acc35f0..3315ab6 100644 --- a/src/util-io.c +++ b/src/util-io.c @@ -390,6 +390,12 @@ iobuf_recv_from_fd(struct iobuf *buf, int fd) fd++; } } + /* Close any remaining fds that didn't fit in the buffer + * to prevent fd leaks */ + while (*fd != -1) { + xclose(*fd); + fd++; + } } nread += rc;