Fix null pointer dereference in virXMLPropStringRequired

Fixes: 65eaf58335

Signed-off-by: Gedalya <gedalya@gedalya.net>
This commit is contained in:
Gedalya 2023-01-03 19:39:36 +08:00
parent 35afa1d2d6
commit b9315159f5

View File

@ -320,7 +320,7 @@ virXMLPropStringRequired(xmlNodePtr node,
{
char *ret = virXMLPropString(node, name);
if (!(*ret))
if (!ret)
virReportError(VIR_ERR_XML_ERROR,
_("Missing required attribute '%s' in element '%s'"),
name, node->name);