aboutsummaryrefslogtreecommitdiff
path: root/qapi/qobject-output-visitor.c
diff options
context:
space:
mode:
Diffstat (limited to 'qapi/qobject-output-visitor.c')
-rw-r--r--qapi/qobject-output-visitor.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/qapi/qobject-output-visitor.c b/qapi/qobject-output-visitor.c
index 3a933b489b..89ffd8a7bf 100644
--- a/qapi/qobject-output-visitor.c
+++ b/qapi/qobject-output-visitor.c
@@ -188,8 +188,8 @@ static void qobject_output_type_any(Visitor *v, const char *name,
QObject **obj, Error **errp)
{
QObjectOutputVisitor *qov = to_qov(v);
- qobject_ref(*obj);
- qobject_output_add_obj(qov, name, *obj);
+
+ qobject_output_add_obj(qov, name, qobject_ref(*obj));
}
static void qobject_output_type_null(Visitor *v, const char *name,
@@ -210,8 +210,7 @@ static void qobject_output_complete(Visitor *v, void *opaque)
assert(qov->root && QSLIST_EMPTY(&qov->stack));
assert(opaque == qov->result);
- qobject_ref(qov->root);
- *qov->result = qov->root;
+ *qov->result = qobject_ref(qov->root);
qov->result = NULL;
}