Skip to contentSkip to conversation

qmp-test: fix response leak

PATCH In review Marc-André Lureau 2 participants 3 messages Mar 26, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qmp-test: fix response leak

Apparently introduced in commit a4f90923b520f1dc0a768634877eb412e5052c26.

---
 tests/qmp-test.c | 1 +
 1 file changed, 1 insertion(+)
tests/qmp-test.c +1 -0
index 558e83540c..8de99a4727 100644
@@ -90,6 +90,7 @@ static void test_qmp_protocol(void)
     test_version(qdict_get(q, "version"));
     capabilities = qdict_get_qlist(q, "capabilities");
     g_assert(capabilities && qlist_empty(capabilities));
+    QDECREF(resp);
 
     /* Test valid command before handshake */
     resp = qtest_qmp(qts, "{ 'execute': 'query-version' }");
Signature · 1 line
2.17.0.rc1.1.g4c4f2b46a3
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Marc-André Lureau

Apparently introduced in commit a4f90923b520f1dc0a768634877eb412e5052c26.

---
  tests/qmp-test.c | 1 +
  1 file changed, 1 insertion(+)

I'll queue this through my qapi tree, unless applying Peter's for-2.12 patches fixes it differently.

Quoted 14 lines
tests/qmp-test.c +1 -0
index 558e83540c..8de99a4727 100644
@@ -90,6 +90,7 @@ static void test_qmp_protocol(void)
      test_version(qdict_get(q, "version"));
      capabilities = qdict_get_qlist(q, "capabilities");
      g_assert(capabilities && qlist_empty(capabilities));
+    QDECREF(resp);
 
      /* Test valid command before handshake */
      resp = qtest_qmp(qts, "{ 'execute': 'query-version' }");
Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org
#2 lore raw
Quoted 11 lines · Eric Blake
Quoted 6 lines · Marc-André Lureau

Apparently introduced in commit a4f90923b520f1dc0a768634877eb412e5052c26.

---
  tests/qmp-test.c | 1 +

  1 file changed, 1 insertion(+)

I'll queue this through my qapi tree, unless applying Peter's for-2.12 patches fixes it differently.

Okay, it's needed, and I'm queuing it.

Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org