Skip to contentSkip to conversation

stable-2.02 - bcache: Fix memory leak in error path

PATCH Marian Csontos 1 participant 1 message Mar 4, 2020

lore
Share & tools
lore
#0 lore raw
Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=deaf304ee6d88cd47632a345b92b3949cd06d752
Commit:        deaf304ee6d88cd47632a345b92b3949cd06d752
Parent:        44c460954be5c63cf5338bd9151344fe2626565f
Author:        Marian Csontos <[email protected]>
AuthorDate:    Wed Mar 4 13:22:10 2020 +0100
Committer:     Marian Csontos <[email protected]>
CommitterDate: Wed Mar 4 13:22:10 2020 +0100

bcache: Fix memory leak in error path

---
 lib/device/bcache.c | 1 +
 1 file changed, 1 insertion(+)
lib/device/bcache.c +1 -0
index 77d1543c0..a74b6b315 100644
@@ -515,6 +515,7 @@ static bool _sync_issue(struct io_engine *ioe, enum dir d, int fd,
 					  (unsigned long long)limit_nbytes,
 					  (unsigned long long)extra_nbytes,
 					  (unsigned long long)_last_byte_sector_size);
+				free(io);
 				return false;
 			}
 		}