tests/qtest: Free unused QMP response
authorAkihiko Odaki <akihiko.odaki@daynix.com>
Thu, 27 Jun 2024 13:37:54 +0000 (22:37 +0900)
committerThomas Huth <thuth@redhat.com>
Tue, 2 Jul 2024 07:34:55 +0000 (09:34 +0200)
This fixes LeakSanitizer warnings.

Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Message-ID: <20240627-san-v2-11-750bb0946dbd@daynix.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
tests/qtest/libqtest.c

index c7f6897d78de971665768bb608c5491319e35101..ca46b1f8d0169f8d3bc80d085f915fd66ff880ef 100644 (file)
@@ -749,6 +749,8 @@ QDict *qtest_qmp_receive(QTestState *s)
                         response, s->eventData)) {
             /* Stash the event for a later consumption */
             s->pending_events = g_list_append(s->pending_events, response);
+        } else {
+            qobject_unref(response);
         }
     }
 }