aboutsummaryrefslogtreecommitdiff
path: root/hw/smbios.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2011-08-20 22:09:37 -0500
committerAnthony Liguori <aliguori@us.ibm.com>2011-08-20 23:01:08 -0500
commit7267c0947d7e8ae5dff7bafd932c3bc285f43e5c (patch)
tree9aa05d6e05ed83e67bf014f6745a3081b8407dc5 /hw/smbios.c
parent14015304b662e8f8ccce46c5a6927af6a14c510b (diff)
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>
Diffstat (limited to 'hw/smbios.c')
-rw-r--r--hw/smbios.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/hw/smbios.c b/hw/smbios.c
index a3ae1de824..8f2e965387 100644
--- a/hw/smbios.c
+++ b/hw/smbios.c
@@ -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;