From 80c3fb786cc236f200026624ded4c668b37ef22d Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Sun, 8 Nov 2015 17:04:03 +0100 Subject: [PATCH] thin: fix error path mem leak Coverity: when parsing of thin-pool status would have failed, it could have leaked memory pool and dmt struct. --- WHATS_NEW | 1 + lib/activate/dev_manager.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/WHATS_NEW b/WHATS_NEW index d0a147605..6368b3273 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.135 - ==================================== + Fix memory leak on error path of failing thin-pool percentage check. Add missing test for failing node allocation in lvmetad. Correct configure messages when enabling/disabling lvmlockd. diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c index 964eef5af..6ec9d22cb 100644 --- a/lib/activate/dev_manager.c +++ b/lib/activate/dev_manager.c @@ -567,7 +567,7 @@ static int _ignore_unusable_thins(struct device *dev) dm_get_next_target(dmt, next, &start, &length, &target_type, ¶ms); if (!dm_get_status_thin_pool(mem, params, &status)) - return_0; + goto_out; if (status->read_only || status->out_of_data_space) { log_warn("WARNING: %s: Thin's thin-pool needs inspection.",