aboutsummaryrefslogtreecommitdiff
path: root/qapi/qmp-input-visitor.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 /qapi/qmp-input-visitor.c
parent14015304b662e8f8ccce46c5a6927af6a14c510b (diff)
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 'qapi/qmp-input-visitor.c')
-rw-r--r--qapi/qmp-input-visitor.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/qapi/qmp-input-visitor.c b/qapi/qmp-input-visitor.c
index 6a1adc9fce..fcf8bf920b 100644
--- a/qapi/qmp-input-visitor.c
+++ b/qapi/qmp-input-visitor.c
@@ -99,7 +99,7 @@ static void qmp_input_start_struct(Visitor *v, void **obj, const char *kind,
}
if (obj) {
- *obj = qemu_mallocz(size);
+ *obj = g_malloc0(size);
}
}
@@ -135,11 +135,11 @@ static GenericList *qmp_input_next_list(Visitor *v, GenericList **list,
return NULL;
}
- entry = qemu_mallocz(sizeof(*entry));
+ entry = g_malloc0(sizeof(*entry));
if (*list) {
so->entry = qlist_next(so->entry);
if (so->entry == NULL) {
- qemu_free(entry);
+ g_free(entry);
return NULL;
}
(*list)->next = entry;
@@ -199,7 +199,7 @@ static void qmp_input_type_str(Visitor *v, char **obj, const char *name,
return;
}
- *obj = qemu_strdup(qstring_get_str(qobject_to_qstring(qobj)));
+ *obj = g_strdup(qstring_get_str(qobject_to_qstring(qobj)));
}
static void qmp_input_type_number(Visitor *v, double *obj, const char *name,
@@ -272,14 +272,14 @@ Visitor *qmp_input_get_visitor(QmpInputVisitor *v)
void qmp_input_visitor_cleanup(QmpInputVisitor *v)
{
qobject_decref(v->obj);
- qemu_free(v);
+ g_free(v);
}
QmpInputVisitor *qmp_input_visitor_new(QObject *obj)
{
QmpInputVisitor *v;
- v = qemu_mallocz(sizeof(*v));
+ v = g_malloc0(sizeof(*v));
v->visitor.start_struct = qmp_input_start_struct;
v->visitor.end_struct = qmp_input_end_struct;