mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-04-01 20:05:19 +00:00
domain_conf: Resolve Coverity REVERSE_INULL
In virDomainActualNetDefFormat() a call to virDomainNetGetActualType(def) was made before a check for (!def) a few lines later. This triggered Coverity to note the possible NULL deref. Just moving the initialization to after the !def checks resolves the issue
This commit is contained in:
parent
bab35f7419
commit
9ba04deca6
@ -16211,11 +16211,13 @@ virDomainActualNetDefFormat(virBufferPtr buf,
|
||||
virDomainNetDefPtr def,
|
||||
unsigned int flags)
|
||||
{
|
||||
unsigned int type = virDomainNetGetActualType(def);
|
||||
const char *typeStr = virDomainNetTypeToString(type);
|
||||
unsigned int type;
|
||||
const char *typeStr;
|
||||
|
||||
if (!def)
|
||||
return 0;
|
||||
type = virDomainNetGetActualType(def);
|
||||
typeStr = virDomainNetTypeToString(type);
|
||||
|
||||
if (!typeStr) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
|
Loading…
x
Reference in New Issue
Block a user