]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
conf: avoid mem leak re-allocating fake NUMA capabilities
authorDaniel P. Berrangé <berrange@redhat.com>
Tue, 17 Dec 2019 16:29:03 +0000 (11:29 -0500)
committerDaniel P. Berrangé <berrange@redhat.com>
Wed, 18 Dec 2019 15:19:22 +0000 (15:19 +0000)
The 'caps' object is already allocated when the fake NUMA
initialization takes place.

Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
src/conf/capabilities.c

index a782d92956c2e03c3ac96db4df928b069f9c6ead..b89fa22d74afeee5a1c8b9f434cbe7e3bf83ea97 100644 (file)
@@ -1631,9 +1631,6 @@ virCapabilitiesHostNUMAInitFake(virCapsHostNUMAPtr caps)
         }
     }
 
-    caps = g_new0(virCapsHostNUMA, 1);
-    caps->cells = g_ptr_array_new_with_free_func(
-        (GDestroyNotify)virCapabilitiesFreeHostNUMACell);
     virCapabilitiesHostNUMAAddCell(caps, 0,
                                    nodeinfo.memory,
 #ifdef __linux__