]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
conf: use correct free function for virDomainVsockDef
authorJán Tomko <jtomko@redhat.com>
Wed, 5 Feb 2020 00:11:53 +0000 (01:11 +0100)
committerJán Tomko <jtomko@redhat.com>
Wed, 5 Feb 2020 09:52:23 +0000 (10:52 +0100)
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 <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/conf/domain_conf.c
src/conf/domain_conf.h

index c3214dc4f352e7fac05ac39b16f4b013c4aa493d..c7cc830c1d576ab699d5596cf373dc1c4452e015 100644 (file)
@@ -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;
 
index c3acb29e6f000519f731c9d42e136d654d3c921b..2bd80c2fbf333e5bfddb326d6c2f308b2624a5e5 100644 (file)
@@ -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);