mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-25 15:15:25 +00:00
cpu_x86: Use glib allocation for virCPUx86Vendor
Signed-off-by: Jiri Denemark <jdenemar@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
8008685830
commit
8a41417b23
@ -830,9 +830,10 @@ x86VendorFree(virCPUx86VendorPtr vendor)
|
|||||||
if (!vendor)
|
if (!vendor)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
VIR_FREE(vendor->name);
|
g_free(vendor->name);
|
||||||
VIR_FREE(vendor);
|
g_free(vendor);
|
||||||
}
|
}
|
||||||
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(virCPUx86Vendor, x86VendorFree);
|
||||||
|
|
||||||
|
|
||||||
static virCPUx86VendorPtr
|
static virCPUx86VendorPtr
|
||||||
@ -860,9 +861,7 @@ x86VendorParse(xmlXPathContextPtr ctxt,
|
|||||||
char *string = NULL;
|
char *string = NULL;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
|
||||||
if (VIR_ALLOC(vendor) < 0)
|
vendor = g_new0(virCPUx86Vendor, 1);
|
||||||
goto cleanup;
|
|
||||||
|
|
||||||
vendor->name = g_strdup(name);
|
vendor->name = g_strdup(name);
|
||||||
|
|
||||||
if (x86VendorFind(map, vendor->name)) {
|
if (x86VendorFind(map, vendor->name)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user