Revision 7267c094 hw/bt-sdp.c
b/hw/bt-sdp.c | ||
---|---|---|
567 | 567 |
int i; |
568 | 568 |
|
569 | 569 |
for (i = 0; i < sdp->services; i ++) { |
570 |
qemu_free(sdp->service_list[i].attribute_list->pair);
|
|
571 |
qemu_free(sdp->service_list[i].attribute_list);
|
|
572 |
qemu_free(sdp->service_list[i].uuid);
|
|
570 |
g_free(sdp->service_list[i].attribute_list->pair);
|
|
571 |
g_free(sdp->service_list[i].attribute_list);
|
|
572 |
g_free(sdp->service_list[i].uuid);
|
|
573 | 573 |
} |
574 |
qemu_free(sdp->service_list);
|
|
575 |
qemu_free(sdp);
|
|
574 |
g_free(sdp->service_list);
|
|
575 |
g_free(sdp);
|
|
576 | 576 |
} |
577 | 577 |
|
578 | 578 |
struct sdp_def_service_s { |
... | ... | |
709 | 709 |
} |
710 | 710 |
record->uuids = 1 << ffs(record->uuids - 1); |
711 | 711 |
record->attribute_list = |
712 |
qemu_mallocz(record->attributes * sizeof(*record->attribute_list));
|
|
712 |
g_malloc0(record->attributes * sizeof(*record->attribute_list));
|
|
713 | 713 |
record->uuid = |
714 |
qemu_mallocz(record->uuids * sizeof(*record->uuid));
|
|
715 |
data = qemu_malloc(len);
|
|
714 |
g_malloc0(record->uuids * sizeof(*record->uuid));
|
|
715 |
data = g_malloc(len);
|
|
716 | 716 |
|
717 | 717 |
record->attributes = 0; |
718 | 718 |
uuid = record->uuid; |
... | ... | |
753 | 753 |
while (service[sdp->services]) |
754 | 754 |
sdp->services ++; |
755 | 755 |
sdp->service_list = |
756 |
qemu_mallocz(sdp->services * sizeof(*sdp->service_list));
|
|
756 |
g_malloc0(sdp->services * sizeof(*sdp->service_list));
|
|
757 | 757 |
|
758 | 758 |
sdp->services = 0; |
759 | 759 |
while (*service) { |
... | ... | |
942 | 942 |
static int bt_l2cap_sdp_new_ch(struct bt_l2cap_device_s *dev, |
943 | 943 |
struct bt_l2cap_conn_params_s *params) |
944 | 944 |
{ |
945 |
struct bt_l2cap_sdp_state_s *sdp = qemu_mallocz(sizeof(*sdp));
|
|
945 |
struct bt_l2cap_sdp_state_s *sdp = g_malloc0(sizeof(*sdp));
|
|
946 | 946 |
struct sdp_def_service_s *services[] = { |
947 | 947 |
&sdp_service_sdp_s, |
948 | 948 |
&sdp_service_hid_s, |
Also available in: Unified diff