From: Jim Meyering Date: Mon, 1 Mar 2010 14:41:15 +0000 (+0100) Subject: cmdPoolDiscoverSources: initialize earlier to avoid FP from clang X-Git-Tag: v0.7.7~56 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=364751578860289facf0dbc1f5e56f5f201f284c;p=thirdparty%2Flibvirt.git 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. --- 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;