diff options
author | Anthony Liguori <aliguori@us.ibm.com> | 2011-08-20 22:09:37 -0500 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2011-08-20 23:01:08 -0500 |
commit | 7267c0947d7e8ae5dff7bafd932c3bc285f43e5c (patch) | |
tree | 9aa05d6e05ed83e67bf014f6745a3081b8407dc5 /error.c | |
parent | 14015304b662e8f8ccce46c5a6927af6a14c510b (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 'error.c')
-rw-r--r-- | error.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -32,7 +32,7 @@ void error_set(Error **errp, const char *fmt, ...) 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 @@ const char *error_get_pretty(Error *err) 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 @@ void error_free(Error *err) { if (err) { QDECREF(err->obj); - qemu_free(err->msg); - qemu_free(err); + g_free(err->msg); + g_free(err); } } @@ -133,7 +133,7 @@ void error_set_qobject(Error **errp, QObject *obj) if (errp == NULL) { return; } - err = qemu_mallocz(sizeof(*err)); + err = g_malloc0(sizeof(*err)); err->obj = qobject_to_qdict(obj); qobject_incref(obj); |