aboutsummaryrefslogtreecommitdiffstats
path: root/openbsd-compat
diff options
context:
space:
mode:
authorEric Faurot <eric@faurot.net>2013-02-05 12:41:55 +0100
committerEric Faurot <eric@faurot.net>2013-02-05 12:41:55 +0100
commitaa0531c54c77c53c92bf155d3faa1fa5cdcc2eed (patch)
tree3b094195790b62f461bb3374499d8dcfda26f2ea /openbsd-compat
parentMerge branch 'portable' of ssh://ssh.poolp.org/git/opensmtpd into portable (diff)
downloadOpenSMTPD-aa0531c54c77c53c92bf155d3faa1fa5cdcc2eed.tar.xz
OpenSMTPD-aa0531c54c77c53c92bf155d3faa1fa5cdcc2eed.zip
merge fixes in imsg.c
Diffstat (limited to 'openbsd-compat')
-rw-r--r--openbsd-compat/imsg.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/openbsd-compat/imsg.c b/openbsd-compat/imsg.c
index 761ae60f..f135e112 100644
--- a/openbsd-compat/imsg.c
+++ b/openbsd-compat/imsg.c
@@ -98,6 +98,7 @@ again:
if (available_fds(imsg_fd_overhead +
(CMSG_SPACE(sizeof(int))-CMSG_SPACE(0))/sizeof(int))) {
errno = EAGAIN;
+ free(ifd);
return (-1);
}
@@ -127,7 +128,7 @@ again:
(char *)CMSG_DATA(cmsg)) / sizeof(int);
for (i = 0; i < j; i++) {
fd = ((int *)CMSG_DATA(cmsg))[i];
- if (i == 0) {
+ if (ifd != NULL) {
ifd->fd = fd;
TAILQ_INSERT_TAIL(&ibuf->fds, ifd,
entry);