From 82f66834ef779414cd2c5cb258d9a45580c07009 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Fri, 21 Dec 2018 21:01:18 +0100 Subject: [PATCH] bcache: fix memory leak on error path Coverity noticed missing free of io struct on error path. --- WHATS_NEW | 1 + lib/device/bcache.c | 1 + 2 files changed, 2 insertions(+) diff --git a/WHATS_NEW b/WHATS_NEW index 1bebff67c..3fe1f3eaa 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.03.02 - =================================== + Fix memleak on bcache error path code. Fix missing unlock on lvm2 dmeventd plugin error path initialization. Improve Makefile dependency tracking. Move VDO support towards V2 target (6.2) support. diff --git a/lib/device/bcache.c b/lib/device/bcache.c index d646d2b98..7b0935352 100644 --- a/lib/device/bcache.c +++ b/lib/device/bcache.c @@ -409,6 +409,7 @@ static bool _sync_issue(struct io_engine *ioe, enum dir d, int fd, (unsigned long long)offset, (unsigned long long)nbytes, (unsigned long long)_last_byte_offset); + free(io); return false; }