提交 6c2e8566 编写于 作者: J John Ferlan

conf: Rework virDomainEmulatorPinDefParseXML

In preparation for using auto free mechanism, change to using the
VIR_STEAL_PTR on @def to @ret and of course be sure to properly clean
up @def in cleanup.
Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
Reviewed-by: NErik Skultety <eskultet@redhat.com>
上级 b6aacfc4
......@@ -18397,6 +18397,7 @@ static virBitmapPtr
virDomainEmulatorPinDefParseXML(xmlNodePtr node)
{
virBitmapPtr def = NULL;
virBitmapPtr ret = NULL;
char *tmp = NULL;
if (!(tmp = virXMLPropString(node, "cpuset"))) {
......@@ -18411,14 +18412,15 @@ virDomainEmulatorPinDefParseXML(xmlNodePtr node)
if (virBitmapIsAllClear(def)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Invalid value of 'cpuset': %s"), tmp);
virBitmapFree(def);
def = NULL;
goto cleanup;
}
VIR_STEAL_PTR(ret, def);
cleanup:
virBitmapFree(def);
VIR_FREE(tmp);
return def;
return ret;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册