In imsg_free() close any fd that was not claimed automatically to prevent
filedescriptor leaks. In ibuf_dequeue() remvoe code which is now part of
imsg_free().
OK tb@
-/* $OpenBSD: imsg-buffer.c,v 1.16 2023/06/19 17:19:50 claudio Exp $ */
+/* $OpenBSD: imsg-buffer.c,v 1.17 2023/10/24 14:05:23 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
{
if (buf == NULL)
return;
-#ifdef NOTYET
if (buf->fd != -1)
close(buf->fd);
-#endif
freezero(buf->buf, buf->size);
free(buf);
}
int fd;
fd = buf->fd;
-#ifdef NOTYET
buf->fd = -1;
-#endif
return (fd);
}
{
TAILQ_REMOVE(&msgbuf->bufs, buf, entry);
- if (buf->fd != -1) {
- close(buf->fd);
- buf->fd = -1;
- }
-
msgbuf->queued--;
ibuf_free(buf);
}