{
g_autoptr(xmlXPathContext) ctxt = NULL;
g_autoptr(virSecretDef) def = NULL;
- g_autofree char *prop = NULL;
+ g_autofree char *ephemeralstr = NULL;
+ g_autofree char *privatestr = NULL;
g_autofree char *uuidstr = NULL;
if (!virXMLNodeNameEqual(root, "secret")) {
def = g_new0(virSecretDef, 1);
- prop = virXPathString("string(./@ephemeral)", ctxt);
- if (prop != NULL) {
- if (virStringParseYesNo(prop, &def->isephemeral) < 0) {
+ if ((ephemeralstr = virXPathString("string(./@ephemeral)", ctxt))) {
+ if (virStringParseYesNo(ephemeralstr, &def->isephemeral) < 0) {
virReportError(VIR_ERR_XML_ERROR, "%s",
_("invalid value of 'ephemeral'"));
return NULL;
}
- VIR_FREE(prop);
}
- prop = virXPathString("string(./@private)", ctxt);
- if (prop != NULL) {
- if (virStringParseYesNo(prop, &def->isprivate) < 0) {
+ if ((privatestr = virXPathString("string(./@private)", ctxt))) {
+ if (virStringParseYesNo(privatestr, &def->isprivate) < 0) {
virReportError(VIR_ERR_XML_ERROR, "%s",
_("invalid value of 'private'"));
return NULL;
}
- VIR_FREE(prop);
}
uuidstr = virXPathString("string(./uuid)", ctxt);
"%s", _("malformed uuid element"));
return NULL;
}
- VIR_FREE(uuidstr);
}
def->description = virXPathString("string(./description)", ctxt);