diff --git a/lib/device/bcache.c b/lib/device/bcache.c index 5e795c56b..43ca63e24 100644 --- a/lib/device/bcache.c +++ b/lib/device/bcache.c @@ -329,6 +329,7 @@ static bool _sync_issue(struct io_engine *ioe, enum dir d, int fd, r = lseek(fd, where, SEEK_SET); if (r < 0) { log_warn("unable to seek to position %llu", (unsigned long long) where); + free(io); return false; } @@ -343,6 +344,7 @@ static bool _sync_issue(struct io_engine *ioe, enum dir d, int fd, if (r < 0) { log_warn("io failed %d", r); + free(io); return false; } @@ -351,6 +353,7 @@ static bool _sync_issue(struct io_engine *ioe, enum dir d, int fd, if (len) { log_warn("short io %u bytes remaining", (unsigned) len); + free(io); return false; }