提交 36475157 编写于 作者: J Jim Meyering

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.
上级 bef10f9a
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册