Revision 7267c094 hw/acpi.c

b/hw/acpi.c
100 100

  
101 101
    if (!acpi_tables) {
102 102
        allen = sizeof(uint16_t);
103
        acpi_tables = qemu_mallocz(allen);
103
        acpi_tables = g_malloc0(allen);
104 104
    } else {
105 105
        allen = acpi_tables_len;
106 106
    }
107 107

  
108 108
    start = allen;
109
    acpi_tables = qemu_realloc(acpi_tables, start + ACPI_TABLE_HDR_SIZE);
109
    acpi_tables = g_realloc(acpi_tables, start + ACPI_TABLE_HDR_SIZE);
110 110
    allen += has_header ? ACPI_TABLE_PFX_SIZE : ACPI_TABLE_HDR_SIZE;
111 111

  
112 112
    /* now read in the data files, reallocating buffer as needed */
......
125 125
            if (r == 0) {
126 126
                break;
127 127
            } else if (r > 0) {
128
                acpi_tables = qemu_realloc(acpi_tables, allen + r);
128
                acpi_tables = g_realloc(acpi_tables, allen + r);
129 129
                memcpy(acpi_tables + allen, data, r);
130 130
                allen += r;
131 131
            } else if (errno != EINTR) {
......
379 379
void acpi_gpe_init(ACPIGPE *gpe, uint8_t len)
380 380
{
381 381
    gpe->len = len;
382
    gpe->sts = qemu_mallocz(len / 2);
383
    gpe->en = qemu_mallocz(len / 2);
382
    gpe->sts = g_malloc0(len / 2);
383
    gpe->en = g_malloc0(len / 2);
384 384
}
385 385

  
386 386
void acpi_gpe_blk(ACPIGPE *gpe, uint32_t blk)

Also available in: Unified diff