mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-26 14:03:49 +03: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
|
||||
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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user