telepathy-qt: dbus-tubes: Fix leaks in dbus test

Dario Freddi drf at kemper.freedesktop.org
Tue Jul 3 15:08:52 PDT 2012


Module: telepathy-qt
Branch: master
Commit: 2a994c6eedf10eae3e7320e276dfdd268de87b3a
URL:    http://cgit.freedesktop.org/telepathy/telepathy-qt/commit/?id=2a994c6eedf10eae3e7320e276dfdd268de87b3a

Author: Dario Freddi <dario.freddi at collabora.com>
Date:   Fri Nov 11 21:35:49 2011 +0100

dbus-tubes: Fix leaks in dbus test

---

 tests/dbus/dbus-tube-chan.cpp |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/tests/dbus/dbus-tube-chan.cpp b/tests/dbus/dbus-tube-chan.cpp
index 00f586b..691df5c 100644
--- a/tests/dbus/dbus-tube-chan.cpp
+++ b/tests/dbus/dbus-tube-chan.cpp
@@ -456,7 +456,6 @@ void TestDBusTubeChan::testOfferSuccess()
         gchar *bobService = g_strdup("org.bob.test");
         tp_tests_dbus_tube_channel_peer_connected_no_stream(mChanService,
                 bobService, bobHandle);
-        g_free(bobService);
 
         mExpectedHandle = bobHandle;
         mExpectedService = QLatin1String("org.bob.test");
@@ -502,6 +501,7 @@ void TestDBusTubeChan::testOfferSuccess()
 
         /* as we run several tests here, let's init/cleanup properly */
         cleanup();
+        g_free (bobService);
     }
 }
 
@@ -555,6 +555,8 @@ void TestDBusTubeChan::testOutgoingBusNameMonitoring()
     QVERIFY(mGotConnectionClosed);
 
     QCOMPARE(mChan->busNames().size(), 0);
+
+    g_free (service);
 }
 
 void TestDBusTubeChan::testExtractBusNameMonitoring()
@@ -619,6 +621,8 @@ void TestDBusTubeChan::testExtractBusNameMonitoring()
     // And the signal shouldn't have been called
     QVERIFY(!mGotConnectionClosed);
     QVERIFY(!mGotRemoteConnection);
+
+    g_free (service);
 }
 
 void TestDBusTubeChan::testAcceptCornerCases()
@@ -739,6 +743,8 @@ void TestDBusTubeChan::testOfferCornerCases()
                 SIGNAL(finished(Tp::PendingOperation *)),
                 SLOT(expectFailure(Tp::PendingOperation*))));
     QCOMPARE(mLoop->exec(), 0);
+
+    g_free (service);
 }
 
 void TestDBusTubeChan::cleanup()



More information about the telepathy-commits mailing list