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>
diff --git a/spice-qemu-char.c b/spice-qemu-char.c
index 95bf6b6..684024b 100644
--- a/spice-qemu-char.c
+++ b/spice-qemu-char.c
@@ -112,7 +112,7 @@
assert(s->datalen == 0);
if (s->bufsize < len) {
s->bufsize = len;
- s->buffer = qemu_realloc(s->buffer, s->bufsize);
+ s->buffer = g_realloc(s->buffer, s->bufsize);
}
memcpy(s->buffer, buf, len);
s->datapos = s->buffer;
@@ -127,7 +127,7 @@
printf("%s\n", __func__);
vmc_unregister_interface(s);
- qemu_free(s);
+ g_free(s);
}
static void spice_chr_guest_open(struct CharDriverState *chr)
@@ -185,8 +185,8 @@
return -EINVAL;
}
- chr = qemu_mallocz(sizeof(CharDriverState));
- s = qemu_mallocz(sizeof(SpiceCharDriver));
+ chr = g_malloc0(sizeof(CharDriverState));
+ s = g_malloc0(sizeof(SpiceCharDriver));
s->chr = chr;
s->debug = debug;
s->active = false;