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/error.c b/error.c
index 74d7398..b802752 100644
--- a/error.c
+++ b/error.c
@@ -32,7 +32,7 @@
return;
}
- err = qemu_mallocz(sizeof(*err));
+ err = g_malloc0(sizeof(*err));
va_start(ap, fmt);
err->obj = qobject_to_qdict(qobject_from_jsonv(fmt, &ap));
@@ -52,7 +52,7 @@
if (err->msg == NULL) {
QString *str;
str = qerror_format(err->fmt, err->obj);
- err->msg = qemu_strdup(qstring_get_str(str));
+ err->msg = g_strdup(qstring_get_str(str));
QDECREF(str);
}
@@ -86,8 +86,8 @@
{
if (err) {
QDECREF(err->obj);
- qemu_free(err->msg);
- qemu_free(err);
+ g_free(err->msg);
+ g_free(err);
}
}
@@ -133,7 +133,7 @@
if (errp == NULL) {
return;
}
- err = qemu_mallocz(sizeof(*err));
+ err = g_malloc0(sizeof(*err));
err->obj = qobject_to_qdict(obj);
qobject_incref(obj);