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.
This commit is contained in:
Jim Meyering 2010-03-01 15:41:15 +01:00
parent bef10f9a05
commit 3647515788

View File

@ -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;