From 364751578860289facf0dbc1f5e56f5f201f284c Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Mon, 1 Mar 2010 15:41:15 +0100 Subject: [PATCH] cmdPoolDiscoverSources: initialize earlier to avoid FP from clang * tools/virsh.c (cmdPoolDiscoverSources): Always initialize srcSpec. Otherwise, clang would report that srcSpec could be used uninitialized in the call to virConnectFindStoragePoolSources. --- tools/virsh.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tools/virsh.c b/tools/virsh.c index 3b1011ccf6..191e7bae6c 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -4431,17 +4431,16 @@ static const vshCmdOptDef opts_find_storage_pool_sources[] = { static int cmdPoolDiscoverSources(vshControl * ctl, const vshCmd * cmd ATTRIBUTE_UNUSED) { - char *type, *srcSpec, *srcSpecFile, *srcList; + char *type, *srcSpecFile, *srcList; + char *srcSpec = NULL; int found; type = vshCommandOptString(cmd, "type", &found); if (!found) return FALSE; srcSpecFile = vshCommandOptString(cmd, "srcSpec", &found); - if (!found) { + if (!found) srcSpecFile = NULL; - srcSpec = NULL; - } if (!vshConnectionUsability(ctl, ctl->conn, TRUE)) return FALSE;