aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2013-05-15 14:57:30 -0500
committerAnthony Liguori <aliguori@us.ibm.com>2013-05-15 14:57:30 -0500
commit6b41659f4eaf1daefd232a7eea6d96885eb52ee7 (patch)
treef512a601bcdb3e2492aac9466e25c94635d2b9c4 /tests
parent8593e050871c632e245190725b11f1e10c629ff2 (diff)
parentad7f375df681503baa6ebef065818868e1216976 (diff)
Merge remote-tracking branch 'luiz/queue/qmp' into staging
# By Michael Roth (1) and Zhangleiqiang (1) # Via Luiz Capitulino * luiz/queue/qmp: qapi: fix leak in unit tests qmp: fix handling of cmd with Equals in qmp-shell Message-id: 1368625179-27962-1-git-send-email-lcapitulino@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/test-visitor-serialization.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/test-visitor-serialization.c b/tests/test-visitor-serialization.c
index e84926f97c..8c8adac6a9 100644
--- a/tests/test-visitor-serialization.c
+++ b/tests/test-visitor-serialization.c
@@ -657,11 +657,16 @@ static void qmp_deserialize(void **native_out, void *datap,
VisitorFunc visit, Error **errp)
{
QmpSerializeData *d = datap;
- QString *output_json = qobject_to_json(qmp_output_get_qobject(d->qov));
- QObject *obj = qobject_from_json(qstring_get_str(output_json));
+ QString *output_json;
+ QObject *obj_orig, *obj;
+
+ obj_orig = qmp_output_get_qobject(d->qov);
+ output_json = qobject_to_json(obj_orig);
+ obj = qobject_from_json(qstring_get_str(output_json));
QDECREF(output_json);
d->qiv = qmp_input_visitor_new(obj);
+ qobject_decref(obj_orig);
qobject_decref(obj);
visit(qmp_input_get_visitor(d->qiv), native_out, errp);
}