diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2010-04-07 18:09:39 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2010-04-07 18:09:39 +0000 |
commit | a2c86dcbf6464634ebbc63ef1cd2966b8ef132f9 (patch) | |
tree | 1e80d73ceb1a54956be5edc14220ba5a62c965e8 | |
parent | ac9daf92d72210570dc9cb63fd0058e4ff50b7a5 (diff) | |
download | rtmux-a2c86dcbf6464634ebbc63ef1cd2966b8ef132f9.tar.gz rtmux-a2c86dcbf6464634ebbc63ef1cd2966b8ef132f9.tar.bz2 rtmux-a2c86dcbf6464634ebbc63ef1cd2966b8ef132f9.zip |
Remove XXX comment and just close received fd if calloc() fails.
If this happens the imsg may no longer be usable as there may be queued
messages, but this is a) already the case with the code now, and b)
would be the case if recvmsg() fails anyway, so we can document that -1
from imsg_read() invalidates the struct imsgbuf.
discussed with and ok eric
-rw-r--r-- | imsg.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -79,7 +79,7 @@ imsg_read(struct imsgbuf *ibuf) cmsg->cmsg_type == SCM_RIGHTS) { fd = (*(int *)CMSG_DATA(cmsg)); if ((ifd = calloc(1, sizeof(struct imsg_fd))) == NULL) { - /* XXX: this return can leak */ + close(fd); return (-1); } ifd->fd = fd; |