Revision 7267c094 libcacard/vcard.c
b/libcacard/vcard.c | ||
---|---|---|
37 | 37 |
{ |
38 | 38 |
VCardBufferResponse *new_buffer; |
39 | 39 |
|
40 |
new_buffer = (VCardBufferResponse *)qemu_malloc(sizeof(VCardBufferResponse));
|
|
41 |
new_buffer->buffer = (unsigned char *)qemu_malloc(size);
|
|
40 |
new_buffer = (VCardBufferResponse *)g_malloc(sizeof(VCardBufferResponse));
|
|
41 |
new_buffer->buffer = (unsigned char *)g_malloc(size);
|
|
42 | 42 |
memcpy(new_buffer->buffer, buffer, size); |
43 | 43 |
new_buffer->buffer_len = size; |
44 | 44 |
new_buffer->current = new_buffer->buffer; |
... | ... | |
53 | 53 |
return; |
54 | 54 |
} |
55 | 55 |
if (buffer_response->buffer) { |
56 |
qemu_free(buffer_response->buffer);
|
|
56 |
g_free(buffer_response->buffer);
|
|
57 | 57 |
} |
58 |
qemu_free(buffer_response);
|
|
58 |
g_free(buffer_response);
|
|
59 | 59 |
} |
60 | 60 |
|
61 | 61 |
|
... | ... | |
102 | 102 |
{ |
103 | 103 |
VCardApplet *applet; |
104 | 104 |
|
105 |
applet = (VCardApplet *)qemu_malloc(sizeof(VCardApplet));
|
|
105 |
applet = (VCardApplet *)g_malloc(sizeof(VCardApplet));
|
|
106 | 106 |
applet->next = NULL; |
107 | 107 |
applet->applet_private = NULL; |
108 | 108 |
applet->applet_private_free = NULL; |
109 | 109 |
applet->process_apdu = applet_process_function; |
110 | 110 |
applet->reset_applet = applet_reset_function; |
111 | 111 |
|
112 |
applet->aid = qemu_malloc(aid_len);
|
|
112 |
applet->aid = g_malloc(aid_len);
|
|
113 | 113 |
memcpy(applet->aid, aid, aid_len); |
114 | 114 |
applet->aid_len = aid_len; |
115 | 115 |
return applet; |
... | ... | |
127 | 127 |
applet->applet_private = NULL; |
128 | 128 |
} |
129 | 129 |
if (applet->aid) { |
130 |
qemu_free(applet->aid);
|
|
130 |
g_free(applet->aid);
|
|
131 | 131 |
applet->aid = NULL; |
132 | 132 |
} |
133 |
qemu_free(applet);
|
|
133 |
g_free(applet);
|
|
134 | 134 |
} |
135 | 135 |
|
136 | 136 |
/* accessor */ |
... | ... | |
151 | 151 |
VCard *new_card; |
152 | 152 |
int i; |
153 | 153 |
|
154 |
new_card = (VCard *)qemu_malloc(sizeof(VCard));
|
|
154 |
new_card = (VCard *)g_malloc(sizeof(VCard));
|
|
155 | 155 |
new_card->applet_list = NULL; |
156 | 156 |
for (i = 0; i < MAX_CHANNEL; i++) { |
157 | 157 |
new_card->current_applet[i] = NULL; |
... | ... | |
199 | 199 |
vcard_delete_applet(current_applet); |
200 | 200 |
} |
201 | 201 |
vcard_buffer_response_delete(vcard->vcard_buffer_response); |
202 |
qemu_free(vcard);
|
|
202 |
g_free(vcard);
|
|
203 | 203 |
return; |
204 | 204 |
} |
205 | 205 |
|
Also available in: Unified diff