Revision 7267c094 hw/pflash_cfi02.c

b/hw/pflash_cfi02.c
617 617
        total_len != (32 * 1024 * 1024) && total_len != (64 * 1024 * 1024))
618 618
        return NULL;
619 619
#endif
620
    pfl = qemu_mallocz(sizeof(pflash_t));
620
    pfl = g_malloc0(sizeof(pflash_t));
621 621
    /* FIXME: Allocate ram ourselves.  */
622 622
    pfl->storage = qemu_get_ram_ptr(off);
623 623
    if (be) {
......
640 640
        ret = bdrv_read(pfl->bs, 0, pfl->storage, chip_len >> 9);
641 641
        if (ret < 0) {
642 642
            cpu_unregister_io_memory(pfl->fl_mem);
643
            qemu_free(pfl);
643
            g_free(pfl);
644 644
            return NULL;
645 645
        }
646 646
    }

Also available in: Unified diff