summaryrefslogtreecommitdiff
path: root/libcacard/vcard.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2011-08-20 22:09:37 -0500
committerAnthony Liguori <aliguori@us.ibm.com>2011-08-20 23:01:08 -0500
commit7267c0947d7e8ae5dff7bafd932c3bc285f43e5c (patch)
tree9aa05d6e05ed83e67bf014f6745a3081b8407dc5 /libcacard/vcard.c
parent14015304b662e8f8ccce46c5a6927af6a14c510b (diff)
downloadqemu-7267c0947d7e8ae5dff7bafd932c3bc285f43e5c.tar.gz
Use glib memory allocation and free functions
qemu_malloc/qemu_free no longer exist after this commit. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'libcacard/vcard.c')
-rw-r--r--libcacard/vcard.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/libcacard/vcard.c b/libcacard/vcard.c
index 29b4cce6e5..b02556ee0c 100644
--- a/libcacard/vcard.c
+++ b/libcacard/vcard.c
@@ -37,8 +37,8 @@ vcard_buffer_response_new(unsigned char *buffer, int size)
{
VCardBufferResponse *new_buffer;
- new_buffer = (VCardBufferResponse *)qemu_malloc(sizeof(VCardBufferResponse));
- new_buffer->buffer = (unsigned char *)qemu_malloc(size);
+ new_buffer = (VCardBufferResponse *)g_malloc(sizeof(VCardBufferResponse));
+ new_buffer->buffer = (unsigned char *)g_malloc(size);
memcpy(new_buffer->buffer, buffer, size);
new_buffer->buffer_len = size;
new_buffer->current = new_buffer->buffer;
@@ -53,9 +53,9 @@ vcard_buffer_response_delete(VCardBufferResponse *buffer_response)
return;
}
if (buffer_response->buffer) {
- qemu_free(buffer_response->buffer);
+ g_free(buffer_response->buffer);
}
- qemu_free(buffer_response);
+ g_free(buffer_response);
}
@@ -102,14 +102,14 @@ vcard_new_applet(VCardProcessAPDU applet_process_function,
{
VCardApplet *applet;
- applet = (VCardApplet *)qemu_malloc(sizeof(VCardApplet));
+ applet = (VCardApplet *)g_malloc(sizeof(VCardApplet));
applet->next = NULL;
applet->applet_private = NULL;
applet->applet_private_free = NULL;
applet->process_apdu = applet_process_function;
applet->reset_applet = applet_reset_function;
- applet->aid = qemu_malloc(aid_len);
+ applet->aid = g_malloc(aid_len);
memcpy(applet->aid, aid, aid_len);
applet->aid_len = aid_len;
return applet;
@@ -127,10 +127,10 @@ vcard_delete_applet(VCardApplet *applet)
applet->applet_private = NULL;
}
if (applet->aid) {
- qemu_free(applet->aid);
+ g_free(applet->aid);
applet->aid = NULL;
}
- qemu_free(applet);
+ g_free(applet);
}
/* accessor */
@@ -151,7 +151,7 @@ vcard_new(VCardEmul *private, VCardEmulFree private_free)
VCard *new_card;
int i;
- new_card = (VCard *)qemu_malloc(sizeof(VCard));
+ new_card = (VCard *)g_malloc(sizeof(VCard));
new_card->applet_list = NULL;
for (i = 0; i < MAX_CHANNEL; i++) {
new_card->current_applet[i] = NULL;
@@ -199,7 +199,7 @@ vcard_free(VCard *vcard)
vcard_delete_applet(current_applet);
}
vcard_buffer_response_delete(vcard->vcard_buffer_response);
- qemu_free(vcard);
+ g_free(vcard);
return;
}