From dc60e49a4da19980945ee3674de84a5aeae947e6 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Tue, 23 Nov 2010 20:39:13 +0000 Subject: [PATCH] Move arg_vgnames from local scope As gcc puts probably all vars on stack this bug was not noticed in runtime. Patch fixes referencing local scope list variable. --- WHATS_NEW | 1 + tools/toollib.c | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/WHATS_NEW b/WHATS_NEW index 7412efca0..669ebd40b 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.78 - ==================================== + Fix out-of-scope variable usage in process_each_lv(). Fix dm_task_destroy(NULL) call in _node_clear_table() error path. Fix resource leak in _rm_blks(). Suppress 'No PV label' message when removing several PVs without mdas. diff --git a/tools/toollib.c b/tools/toollib.c index 6aa0fbb13..9af163070 100644 --- a/tools/toollib.c +++ b/tools/toollib.c @@ -198,6 +198,7 @@ int process_each_lv(struct cmd_context *cmd, int argc, char **argv, struct dm_list failed_lvnames; struct dm_list tags, lvnames; struct dm_list arg_lvnames; /* Cmdline vgname or vgname/lvname */ + struct dm_list arg_vgnames; char *vglv; size_t vglv_sz; @@ -208,8 +209,6 @@ int process_each_lv(struct cmd_context *cmd, int argc, char **argv, dm_list_init(&failed_lvnames); if (argc) { - struct dm_list arg_vgnames; - log_verbose("Using logical volume(s) on command line"); dm_list_init(&arg_vgnames); -- 2.43.5