Commit id '
73eda710' added virDomainKeyWrapDefParseXML which uses
virXPathNodeSet, but does not handle a -1 return thus causing a possible
loop condition exit problem later when the return value is used.
Change the logic to return the value from virXPathNodeSet if <= 0
xmlNodePtr *nodes = NULL;
int n;
- if (!(n = virXPathNodeSet("./keywrap/cipher", ctxt, &nodes)))
- return 0;
+ if ((n = virXPathNodeSet("./keywrap/cipher", ctxt, &nodes)) < 0)
+ return n;
if (VIR_ALLOC(def->keywrap) < 0)
goto cleanup;