saved_node = ctxt->node;
/* Allocate a security labels based on XML */
- if ((n = virXPathNodeSet("./seclabel", ctxt, &list)) == 0)
+ if ((n = virXPathNodeSet("./seclabel", ctxt, &list)) < 0)
+ goto error;
+ if (n == 0)
return 0;
if (VIR_ALLOC_N(def->seclabels, n) < 0) {
virSecurityLabelDefPtr vmDef = NULL;
char *model, *relabel, *label;
- if ((n = virXPathNodeSet("./seclabel", ctxt, &list)) == 0)
+ if ((n = virXPathNodeSet("./seclabel", ctxt, &list)) < 0)
+ goto error;
+ if (n == 0)
return 0;
if (VIR_ALLOC_N(seclabels, n) < 0) {
virStoragePoolOptionsPtr options;
char *name = NULL;
char *port = NULL;
+ int n;
relnode = ctxt->node;
ctxt->node = node;
VIR_FREE(format);
}
- source->nhost = virXPathNodeSet("./host", ctxt, &nodeset);
+ if ((n = virXPathNodeSet("./host", ctxt, &nodeset)) < 0)
+ goto cleanup;
+ source->nhost = n;
if (source->nhost) {
if (VIR_ALLOC_N(source->hosts, source->nhost) < 0) {