mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00:00
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:
parent
bef10f9a05
commit
3647515788
@ -4431,17 +4431,16 @@ static const vshCmdOptDef opts_find_storage_pool_sources[] = {
|
|||||||
static int
|
static int
|
||||||
cmdPoolDiscoverSources(vshControl * ctl, const vshCmd * cmd ATTRIBUTE_UNUSED)
|
cmdPoolDiscoverSources(vshControl * ctl, const vshCmd * cmd ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
char *type, *srcSpec, *srcSpecFile, *srcList;
|
char *type, *srcSpecFile, *srcList;
|
||||||
|
char *srcSpec = NULL;
|
||||||
int found;
|
int found;
|
||||||
|
|
||||||
type = vshCommandOptString(cmd, "type", &found);
|
type = vshCommandOptString(cmd, "type", &found);
|
||||||
if (!found)
|
if (!found)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
srcSpecFile = vshCommandOptString(cmd, "srcSpec", &found);
|
srcSpecFile = vshCommandOptString(cmd, "srcSpec", &found);
|
||||||
if (!found) {
|
if (!found)
|
||||||
srcSpecFile = NULL;
|
srcSpecFile = NULL;
|
||||||
srcSpec = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
|
if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user