[next] telepathy-glib: account test: don't leak copied strings

Simon McVittie smcv at kemper.freedesktop.org
Thu Mar 13 07:08:35 PDT 2014


Module: telepathy-glib
Branch: next
Commit: 087f0fb63c7ba8bb71eb3298a9c8299c52a61c03
URL:    http://cgit.freedesktop.org/telepathy/telepathy-glib/commit/?id=087f0fb63c7ba8bb71eb3298a9c8299c52a61c03

Author: Simon McVittie <simon.mcvittie at collabora.co.uk>
Date:   Mon Mar 10 17:30:56 2014 +0000

account test: don't leak copied strings

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=76000
Reviewed-by: Guillaume Desmottes

---

 tests/dbus/account.c |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/tests/dbus/account.c b/tests/dbus/account.c
index eadac87..dde9ceb 100644
--- a/tests/dbus/account.c
+++ b/tests/dbus/account.c
@@ -747,8 +747,9 @@ test_connection (Test *test,
   g_assert_cmpstr (tp_proxy_get_object_path (conn), ==, conn1_path);
   g_assert_cmpuint (test_get_times_notified (test, "connection"), ==, 1);
 
-  g_assert_cmpstr (tp_account_dup_detailed_error (test->account, NULL),
-      ==, TP_ERROR_STR_CANCELLED);
+  s = tp_account_dup_detailed_error (test->account, NULL);
+  g_assert_cmpstr (s, ==, TP_ERROR_STR_CANCELLED);
+  g_free (s);
 
   /* a no-op "change" */
 
@@ -796,8 +797,9 @@ test_connection (Test *test,
   conn = tp_account_get_connection (test->account);
   g_assert (conn == NULL);
 
-  g_assert_cmpstr (tp_account_dup_detailed_error (test->account, NULL),
-      ==, TP_ERROR_STR_ENCRYPTION_ERROR);
+  s = tp_account_dup_detailed_error (test->account, NULL);
+  g_assert_cmpstr (s, ==, TP_ERROR_STR_ENCRYPTION_ERROR);
+  g_free (s);
 
   /* another connection */
 



More information about the telepathy-commits mailing list