Commit 93b53937 authored by Pavel Tikhomirov's avatar Pavel Tikhomirov Committed by Andrei Vagin

criu: fix leaks detected by coverity scan part 2

*** CID 179043:    (USE_AFTER_FREE)
close bfd fd safe so that we won't have double close

*** CID 179041:  Resource leaks  (RESOURCE_LEAK)
don't forget to close fd on error
Signed-off-by: 's avatarPavel Tikhomirov <ptikhomirov@virtuozzo.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent 31d84043
......@@ -91,7 +91,7 @@ static void buf_put(struct xbuf *xb)
static int bfdopen(struct bfd *f, bool writable)
{
if (buf_get(&f->b)) {
close(f->fd);
close_safe(&f->fd);
return -1;
}
......
......@@ -769,6 +769,7 @@ static int kerndat_try_load_cache(void)
ret = read(fd, &kdat, sizeof(kdat));
if (ret < 0) {
pr_perror("Can't read kdat cache");
close(fd);
return -1;
}
......
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