mirror of
https://github.com/mii443/qemu.git
synced 2025-12-07 21:18:22 +00:00
Use glib memory allocation and free functions
qemu_malloc/qemu_free no longer exist after this commit. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
@@ -105,9 +105,9 @@ void smbios_add_field(int type, int offset, int len, void *data)
|
||||
|
||||
if (!smbios_entries) {
|
||||
smbios_entries_len = sizeof(uint16_t);
|
||||
smbios_entries = qemu_mallocz(smbios_entries_len);
|
||||
smbios_entries = g_malloc0(smbios_entries_len);
|
||||
}
|
||||
smbios_entries = qemu_realloc(smbios_entries, smbios_entries_len +
|
||||
smbios_entries = g_realloc(smbios_entries, smbios_entries_len +
|
||||
sizeof(*field) + len);
|
||||
field = (struct smbios_field *)(smbios_entries + smbios_entries_len);
|
||||
field->header.type = SMBIOS_FIELD_ENTRY;
|
||||
@@ -192,10 +192,10 @@ int smbios_entry_add(const char *t)
|
||||
|
||||
if (!smbios_entries) {
|
||||
smbios_entries_len = sizeof(uint16_t);
|
||||
smbios_entries = qemu_mallocz(smbios_entries_len);
|
||||
smbios_entries = g_malloc0(smbios_entries_len);
|
||||
}
|
||||
|
||||
smbios_entries = qemu_realloc(smbios_entries, smbios_entries_len +
|
||||
smbios_entries = g_realloc(smbios_entries, smbios_entries_len +
|
||||
sizeof(*table) + size);
|
||||
table = (struct smbios_table *)(smbios_entries + smbios_entries_len);
|
||||
table->header.type = SMBIOS_TABLE_ENTRY;
|
||||
|
||||
Reference in New Issue
Block a user