Unverified Commit d2ff3f89 by Christian Brauner Committed by GitHub

Merge pull request #2418 from 2xsec/bugfix

fix fd handle leak
parents d3d9f55b 5090cb06
......@@ -91,6 +91,7 @@ static void opentty(const char * tty, int which) {
flags &= ~O_NONBLOCK;
if (fcntl(fd, F_SETFL, flags) < 0) {
printf("WARN: could not set fd flags: %s\n", strerror(errno));
close(fd);
return;
}
......
......@@ -555,7 +555,10 @@ int main(int argc, char *argv[])
printf("All get_item tests passed\n");
fret = EXIT_SUCCESS;
out:
c->destroy(c);
lxc_container_put(c);
if (c) {
c->destroy(c);
lxc_container_put(c);
}
exit(fret);
}
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