master - cov: fix memleak on bcache io error path
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=9b85ecb85b2875bd6743a97147355218879aef3a Commit: 9b85ecb85b2875bd6743a97147355218879aef3a Parent: 3222924c3dd595f6d185b180341acfa46954307a Author: Zdenek Kabelac <[email protected]> AuthorDate: Mon Oct 15 14:29:52 2018 +0200 Committer: Zdenek Kabelac <[email protected]> CommitterDate: Mon Oct 15 17:49:44 2018 +0200
cov: fix memleak on bcache io error path
Drop allocated IO.
merge free bache
--- lib/device/bcache.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
lib/device/bcache.c +3 -0
@@ -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; }