From cf269f15dcd50e460c013cb9f1937ffb26f600ba Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Tue, 21 Nov 2017 10:50:37 +0000 Subject: [PATCH] test_peer_ping: Don't leak one method call per invocation Previously, we allocated m both during initialization, and after deciding not to skip this test. Signed-off-by: Simon McVittie --- test/dbus-daemon.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/dbus-daemon.c b/test/dbus-daemon.c index f9d8f923..3d5c147f 100644 --- a/test/dbus-daemon.c +++ b/test/dbus-daemon.c @@ -1251,22 +1251,21 @@ test_peer_get_machine_id (Fixture *f, dbus_clear_message (&m); dbus_clear_pending_call (&pc); dbus_free (what_i_think); } static void test_peer_ping (Fixture *f, gconstpointer context) { - DBusMessage *m = dbus_message_new_method_call (DBUS_SERVICE_DBUS, - DBUS_PATH_DBUS, DBUS_INTERFACE_PEER, "Ping"); + DBusMessage *m = NULL; DBusPendingCall *pc = NULL; DBusError error = DBUS_ERROR_INIT; if (f->skip) return; m = dbus_message_new_method_call (DBUS_SERVICE_DBUS, DBUS_PATH_DBUS, DBUS_INTERFACE_PEER, "Ping"); if (m == NULL || -- 2.15.0