Revision 7267c094 hw/baum.c

b/hw/baum.c
559 559
    if (ret == -1 && (brlapi_errno != BRLAPI_ERROR_LIBCERR || errno != EINTR)) {
560 560
        brlapi_perror("baum: brlapi_readKey");
561 561
        brlapi__closeConnection(baum->brlapi);
562
        qemu_free(baum->brlapi);
562
        g_free(baum->brlapi);
563 563
        baum->brlapi = NULL;
564 564
    }
565 565
}
......
571 571
    qemu_free_timer(baum->cellCount_timer);
572 572
    if (baum->brlapi) {
573 573
        brlapi__closeConnection(baum->brlapi);
574
        qemu_free(baum->brlapi);
574
        g_free(baum->brlapi);
575 575
    }
576
    qemu_free(baum);
576
    g_free(baum);
577 577
}
578 578

  
579 579
int chr_baum_init(QemuOpts *opts, CharDriverState **_chr)
......
586 586
#endif
587 587
    int tty;
588 588

  
589
    baum = qemu_mallocz(sizeof(BaumDriverState));
590
    baum->chr = chr = qemu_mallocz(sizeof(CharDriverState));
589
    baum = g_malloc0(sizeof(BaumDriverState));
590
    baum->chr = chr = g_malloc0(sizeof(CharDriverState));
591 591

  
592 592
    chr->opaque = baum;
593 593
    chr->chr_write = baum_write;
......
595 595
    chr->chr_accept_input = baum_accept_input;
596 596
    chr->chr_close = baum_close;
597 597

  
598
    handle = qemu_mallocz(brlapi_getHandleSize());
598
    handle = g_malloc0(brlapi_getHandleSize());
599 599
    baum->brlapi = handle;
600 600

  
601 601
    baum->brlapi_fd = brlapi__openConnection(handle, NULL, NULL);
......
636 636
    qemu_free_timer(baum->cellCount_timer);
637 637
    brlapi__closeConnection(handle);
638 638
fail_handle:
639
    qemu_free(handle);
640
    qemu_free(chr);
641
    qemu_free(baum);
639
    g_free(handle);
640
    g_free(chr);
641
    g_free(baum);
642 642
    return -EIO;
643 643
}

Also available in: Unified diff