Commit 92ffb6d8 by Dwight Engen Committed by Serge Hallyn

coverity: fix fd leak in error case (1011105)

I inadvertently introduced this with commit 8bf1e61e. Signed-off-by: 's avatarDwight Engen <dwight.engen@oracle.com> Signed-off-by: 's avatarSerge Hallyn <serge.hallyn@ubuntu.com>
parent 09227be2
...@@ -106,8 +106,10 @@ static void lxc_monitor_fifo_send(struct lxc_msg *msg, const char *lxcpath) ...@@ -106,8 +106,10 @@ static void lxc_monitor_fifo_send(struct lxc_msg *msg, const char *lxcpath)
return; return;
} }
if (fcntl(fd, F_SETFL, O_WRONLY) < 0) if (fcntl(fd, F_SETFL, O_WRONLY) < 0) {
close(fd);
return; return;
}
ret = write(fd, msg, sizeof(*msg)); ret = write(fd, msg, sizeof(*msg));
if (ret != sizeof(*msg)) { if (ret != sizeof(*msg)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment