提交 3f40a487 编写于 作者: J Ján Tomko

conf: use correct free function for virDomainDeviceDef

Simple g_autofree is not enough if we put allocated
data into the device structure.

Define the AUTOPTR_CLEANUP function and use it here.
Signed-off-by: NJán Tomko <jtomko@redhat.com>
Reported-by: NXu Yandong <xuyandong2@huawei.com>
Reviewed-by: NPeter Krempa <pkrempa@redhat.com>
上级 4ab2120f
......@@ -16516,7 +16516,7 @@ virDomainDeviceDefParse(const char *xmlStr,
g_autoptr(xmlDoc) xml = NULL;
xmlNodePtr node;
g_autoptr(xmlXPathContext) ctxt = NULL;
g_autofree virDomainDeviceDefPtr dev = NULL;
g_autoptr(virDomainDeviceDef) dev = NULL;
if (!(xml = virXMLParseStringCtxt(xmlStr, _("(device_definition)"), &ctxt)))
return NULL;
......
......@@ -2916,6 +2916,7 @@ void virDomainRedirdevDefFree(virDomainRedirdevDefPtr def);
void virDomainRedirFilterDefFree(virDomainRedirFilterDefPtr def);
void virDomainShmemDefFree(virDomainShmemDefPtr def);
void virDomainDeviceDefFree(virDomainDeviceDefPtr def);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(virDomainDeviceDef, virDomainDeviceDefFree);
virDomainDeviceDefPtr virDomainDeviceDefCopy(virDomainDeviceDefPtr src,
const virDomainDef *def,
virDomainXMLOptionPtr xmlopt,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册