提交 9ba04dec 编写于 作者: J John Ferlan

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
上级 bab35f74
...@@ -16211,11 +16211,13 @@ virDomainActualNetDefFormat(virBufferPtr buf, ...@@ -16211,11 +16211,13 @@ virDomainActualNetDefFormat(virBufferPtr buf,
virDomainNetDefPtr def, virDomainNetDefPtr def,
unsigned int flags) unsigned int flags)
{ {
unsigned int type = virDomainNetGetActualType(def); unsigned int type;
const char *typeStr = virDomainNetTypeToString(type); const char *typeStr;
if (!def) if (!def)
return 0; return 0;
type = virDomainNetGetActualType(def);
typeStr = virDomainNetTypeToString(type);
if (!typeStr) { if (!typeStr) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册