diff options
author | Igor Mammedov <imammedo@redhat.com> | 2014-01-16 17:34:36 +0100 |
---|---|---|
committer | Luiz Capitulino <lcapitulino@redhat.com> | 2014-01-28 11:28:08 -0500 |
commit | 69252c046741a0955ddb90250f416a2199305091 (patch) | |
tree | ac033d9b42e994701575d2fc14033ac160a9de66 /qmp.c | |
parent | 0169c511554cb0014a00290b0d3d26c31a49818f (diff) |
object_add: consolidate error handling
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Diffstat (limited to 'qmp.c')
-rw-r--r-- | qmp.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -549,15 +549,17 @@ void object_add(const char *type, const char *id, const QDict *qdict, for (e = qdict_first(qdict); e; e = qdict_next(qdict, e)) { object_property_set(obj, v, e->key, &local_err); if (local_err) { - error_propagate(errp, local_err); - object_unref(obj); - return; + goto out; } } } object_property_add_child(container_get(object_get_root(), "/objects"), - id, obj, errp); + id, obj, &local_err); +out: + if (local_err) { + error_propagate(errp, local_err); + } object_unref(obj); } |