From db5e7962c9044337aa0bd495bca6ec5d93feab32 Mon Sep 17 00:00:00 2001 From: Dave Wysochanski Date: Wed, 15 Jul 2009 12:15:36 +0000 Subject: [PATCH] Fix memory leak in _process_one_vg error path. Author: Dave Wysochanski --- tools/toollib.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/toollib.c b/tools/toollib.c index 75ce4c0fa..8f38d4948 100644 --- a/tools/toollib.c +++ b/tools/toollib.c @@ -432,8 +432,10 @@ static int _process_one_vg(struct cmd_context *cmd, const char *vg_name, vg = vg_read(cmd, vg_name, vgid, flags); if (vg_read_error(vg) == FAILED_ALLOCATION || - vg_read_error(vg) == FAILED_NOTFOUND) + vg_read_error(vg) == FAILED_NOTFOUND) { + vg_release(vg); return ECMD_FAILED; + } if (!dm_list_empty(tags)) { /* Only process if a tag matches or it's on arg_vgnames */ -- 2.43.5