If the call to virXPathNodeSet to set naddresses fails, Coverity notes
that the subsequent VIR_ALLOC_N cannot have a negative value (well it
probably wouldn't be negative per se).
Signed-off-by: John Ferlan <jferlan@redhat.com>
data->pci_dev.physical_function) < 0)
goto out;
} else if (STREQ(type, "virt_functions")) {
- int naddresses = virXPathNodeSet("./address", ctxt, &addresses);
+ int naddresses;
+
+ if ((naddresses = virXPathNodeSet("./address", ctxt, &addresses)) < 0)
+ goto out;
if (maxFuncsStr &&
virStrToLong_uip(maxFuncsStr, NULL, 10,