qemu: domain: Use VIR_AUTOFREE in qemuDomainObjPrivateXMLParseBlockjobs

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2019-03-04 16:34:54 +01:00
parent 8f956ee71a
commit 63ff670f40

View File

@ -2668,14 +2668,13 @@ static int
qemuDomainObjPrivateXMLParseBlockjobs(qemuDomainObjPrivatePtr priv, qemuDomainObjPrivateXMLParseBlockjobs(qemuDomainObjPrivatePtr priv,
xmlXPathContextPtr ctxt) xmlXPathContextPtr ctxt)
{ {
char *active; VIR_AUTOFREE(char *) active = NULL;
int tmp; int tmp;
if ((active = virXPathString("string(./blockjobs/@active)", ctxt)) && if ((active = virXPathString("string(./blockjobs/@active)", ctxt)) &&
(tmp = virTristateBoolTypeFromString(active)) > 0) (tmp = virTristateBoolTypeFromString(active)) > 0)
priv->reconnectBlockjobs = tmp; priv->reconnectBlockjobs = tmp;
VIR_FREE(active);
return 0; return 0;
} }