From 4166856c23800d727bd8004a8325fdd960353629 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1n=20Tomko?= Date: Wed, 5 Feb 2020 01:11:53 +0100 Subject: [PATCH] conf: use correct free function for virDomainVsockDef MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Technically, there is no memleak here, since the only allocations are filled by virDomainDeviceInfoParseXML, which cleans up after itself. Signed-off-by: Ján Tomko Reviewed-by: Michal Privoznik --- src/conf/domain_conf.c | 2 +- src/conf/domain_conf.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index c3214dc4f3..c7cc830c1d 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -16458,7 +16458,7 @@ virDomainVsockDefParseXML(virDomainXMLOptionPtr xmlopt, xmlNodePtr cid; int val; g_autofree char *tmp = NULL; - g_autofree virDomainVsockDefPtr vsock = NULL; + g_autoptr(virDomainVsockDef) vsock = NULL; ctxt->node = node; diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index c3acb29e6f..2bd80c2fbf 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -2891,6 +2891,7 @@ void virDomainFSDefFree(virDomainFSDefPtr def); void virDomainActualNetDefFree(virDomainActualNetDefPtr def); virDomainVsockDefPtr virDomainVsockDefNew(virDomainXMLOptionPtr xmlopt); void virDomainVsockDefFree(virDomainVsockDefPtr vsock); +G_DEFINE_AUTOPTR_CLEANUP_FUNC(virDomainVsockDef, virDomainVsockDefFree); void virDomainNetDefClear(virDomainNetDefPtr def); void virDomainNetDefFree(virDomainNetDefPtr def); void virDomainSmartcardDefFree(virDomainSmartcardDefPtr def); -- GitLab