coverity: #1425889

do not call close on bad file descriptor Signed-off-by: 's avatarChristian Brauner <christian.brauner@ubuntu.com>
parent 2bba6e49
...@@ -316,7 +316,8 @@ static int lxc_cmd(const char *name, struct lxc_cmd_rr *cmd, int *stopped, ...@@ -316,7 +316,8 @@ static int lxc_cmd(const char *name, struct lxc_cmd_rr *cmd, int *stopped,
*stopped = 1; *stopped = 1;
out: out:
if (!stay_connected || ret <= 0) if (!stay_connected || ret <= 0)
close(client_fd); if (client_fd >= 0)
close(client_fd);
if (stay_connected && ret > 0) if (stay_connected && ret > 0)
cmd->rsp.ret = client_fd; cmd->rsp.ret = client_fd;
......
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