diff --git a/qemu/include/qapi/qmp-output-visitor.h b/qemu/include/qapi/qmp-output-visitor.h index 22667706..29c9a2e3 100644 --- a/qemu/include/qapi/qmp-output-visitor.h +++ b/qemu/include/qapi/qmp-output-visitor.h @@ -20,7 +20,6 @@ typedef struct QmpOutputVisitor QmpOutputVisitor; QmpOutputVisitor *qmp_output_visitor_new(void); -void qmp_output_visitor_cleanup(QmpOutputVisitor *v); QObject *qmp_output_get_qobject(QmpOutputVisitor *v); Visitor *qmp_output_get_visitor(QmpOutputVisitor *v); diff --git a/qemu/qapi/qmp-output-visitor.c b/qemu/qapi/qmp-output-visitor.c index 95915180..5272281e 100644 --- a/qemu/qapi/qmp-output-visitor.c +++ b/qemu/qapi/qmp-output-visitor.c @@ -218,21 +218,15 @@ Visitor *qmp_output_get_visitor(QmpOutputVisitor *v) static void qmp_output_free(Visitor *v) { QmpOutputVisitor *qov = to_qov(v); - - qmp_output_visitor_cleanup(qov); -} - -void qmp_output_visitor_cleanup(QmpOutputVisitor *v) -{ QStackEntry *e, *tmp; - QTAILQ_FOREACH_SAFE(e, &v->stack, node, tmp) { - QTAILQ_REMOVE(&v->stack, e, node); + QTAILQ_FOREACH_SAFE(e, &qov->stack, node, tmp) { + QTAILQ_REMOVE(&qov->stack, e, node); g_free(e); } - qobject_decref(v->root); - g_free(v); + qobject_decref(qov->root); + g_free(qov); } QmpOutputVisitor *qmp_output_visitor_new(void) diff --git a/qemu/qom/qom-qobject.c b/qemu/qom/qom-qobject.c index 9dc2adb9..fff1e074 100644 --- a/qemu/qom/qom-qobject.c +++ b/qemu/qom/qom-qobject.c @@ -41,6 +41,6 @@ QObject *object_property_get_qobject(struct uc_struct *uc, Object *obj, const ch ret = qmp_output_get_qobject(qov); } error_propagate(errp, local_err); - qmp_output_visitor_cleanup(qov); + visit_free(qmp_output_get_visitor(qov)); return ret; }