aboutsummaryrefslogtreecommitdiff
path: root/qmp.c
diff options
context:
space:
mode:
Diffstat (limited to 'qmp.c')
-rw-r--r--qmp.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/qmp.c b/qmp.c
index 0f46171aad..a67e0c4539 100644
--- a/qmp.c
+++ b/qmp.c
@@ -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);
}