[libvirt PATCH 03/39] cpu_x86: Use glib allocation for virCPUx86Vendor

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Jiri Denemark <jdenemar@xxxxxxxxxx>
---
 src/cpu/cpu_x86.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
index f0d9b7056a..6fad4af922 100644
--- a/src/cpu/cpu_x86.c
+++ b/src/cpu/cpu_x86.c
@@ -830,9 +830,10 @@ x86VendorFree(virCPUx86VendorPtr vendor)
     if (!vendor)
         return;
 
-    VIR_FREE(vendor->name);
-    VIR_FREE(vendor);
+    g_free(vendor->name);
+    g_free(vendor);
 }
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(virCPUx86Vendor, x86VendorFree);
 
 
 static virCPUx86VendorPtr
@@ -860,9 +861,7 @@ x86VendorParse(xmlXPathContextPtr ctxt,
     char *string = NULL;
     int ret = -1;
 
-    if (VIR_ALLOC(vendor) < 0)
-        goto cleanup;
-
+    vendor = g_new0(virCPUx86Vendor, 1);
     vendor->name = g_strdup(name);
 
     if (x86VendorFind(map, vendor->name)) {
-- 
2.26.0





[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux