Unverified Commit 09ef5d95 by Stéphane Graber Committed by GitHub

Merge pull request #2505 from brauner/2018-07-31/bugfixes

coverity: #438136
parents a3cf04da aeba3f80
......@@ -211,6 +211,7 @@ static bool do_destroy_with_snapshots(struct lxc_container *c)
char *lxcname = NULL;
int fd;
int ret;
ssize_t bytes;
/* Destroy clones. */
ret = snprintf(path, MAXPATHLEN, "%s/%s/lxc_snapshots", c->config_path, c->name);
......@@ -233,9 +234,9 @@ static bool do_destroy_with_snapshots(struct lxc_container *c)
return false;
}
ret = lxc_read_nointr(fd, buf, fbuf.st_size);
bytes = lxc_read_nointr(fd, buf, fbuf.st_size);
close(fd);
if (ret < 0) {
if (bytes != (ssize_t)fbuf.st_size) {
ERROR("Could not read %s", path);
free(buf);
return false;
......
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