[glib] Plug some leaks in the GIO tests



commit 995a2eb50bf7d9e46c029768691f93b31e09bdf8
Author: Simon McVittie <simon mcvittie collabora co uk>
Date:   Tue Dec 13 18:18:07 2011 +0000

    Plug some leaks in the GIO tests
    
    Signed-off-by: Simon McVittie <simon mcvittie collabora co uk>
    Bug: https://bugzilla.gnome.org/show_bug.cgi?id=666115
    Reviewed-by: Matthias Clasen <mclasen redhat com>

 gio/tests/data-input-stream.c |    1 +
 gio/tests/network-monitor.c   |    8 ++++++++
 gio/tests/pollable.c          |    1 +
 gio/tests/socket.c            |    3 +++
 gio/tests/tls-certificate.c   |    1 +
 5 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/gio/tests/data-input-stream.c b/gio/tests/data-input-stream.c
index 3d01a73..2dddb56 100644
--- a/gio/tests/data-input-stream.c
+++ b/gio/tests/data-input-stream.c
@@ -315,6 +315,7 @@ test_read_upto (void)
           g_assert (memchr (DATA_SEP, stop_char, DATA_SEP_LEN) != NULL);
           g_assert_no_error (error);
         }
+      g_free (data);
     }
   g_assert_no_error (error);
   g_assert_cmpint (line, ==, DATA_PARTS_NUM);
diff --git a/gio/tests/network-monitor.c b/gio/tests/network-monitor.c
index 0ba9ec4..8c0b0c8 100644
--- a/gio/tests/network-monitor.c
+++ b/gio/tests/network-monitor.c
@@ -197,6 +197,8 @@ test_default (void)
   run_tests (monitor, unmatched, TRUE);
 
   assert_signals (monitor, FALSE, FALSE, TRUE);
+
+  g_object_unref (monitor);
 }
 
 static void
@@ -223,6 +225,8 @@ test_remove_default (void)
   run_tests (monitor, netlocal6.addresses, FALSE);
   run_tests (monitor, netfe80.addresses, FALSE);
   run_tests (monitor, unmatched, FALSE);
+
+  g_object_unref (monitor);
 }
 
 static void
@@ -294,6 +298,8 @@ test_add_networks (void)
   run_tests (monitor, netlocal6.addresses, TRUE);
   run_tests (monitor, netfe80.addresses, TRUE);
   run_tests (monitor, unmatched, FALSE);
+
+  g_object_unref (monitor);
 }
 
 static void
@@ -387,6 +393,8 @@ test_remove_networks (void)
   run_tests (monitor, netlocal6.addresses, FALSE);
   run_tests (monitor, netfe80.addresses, FALSE);
   run_tests (monitor, unmatched, FALSE);
+
+  g_object_unref (monitor);
 }
 
 
diff --git a/gio/tests/pollable.c b/gio/tests/pollable.c
index 8669e2b..f954bd8 100644
--- a/gio/tests/pollable.c
+++ b/gio/tests/pollable.c
@@ -221,6 +221,7 @@ test_pollable_socket (void)
   g_object_unref (server_conn);
   g_object_unref (client);
   g_object_unref (listener);
+  g_object_unref (effective_address);
 }
 
 int
diff --git a/gio/tests/socket.c b/gio/tests/socket.c
index 4e0710f..d2919b8 100644
--- a/gio/tests/socket.c
+++ b/gio/tests/socket.c
@@ -68,6 +68,7 @@ echo_server_thread (gpointer user_data)
 
   g_socket_close (sock, &error);
   g_assert_no_error (error);
+  g_object_unref (sock);
   return NULL;
 }
 
@@ -449,6 +450,7 @@ v4mapped_server_thread (gpointer user_data)
 
   g_socket_close (sock, &error);
   g_assert_no_error (error);
+  g_object_unref (sock);
   return NULL;
 }
 
@@ -491,6 +493,7 @@ test_ipv6_v4mapped (void)
 
   g_object_unref (data->server);
   g_object_unref (client);
+  g_object_unref (v4addr);
 
   g_slice_free (IPTestData, data);
 }
diff --git a/gio/tests/tls-certificate.c b/gio/tests/tls-certificate.c
index 1bc349d..a1796da 100644
--- a/gio/tests/tls-certificate.c
+++ b/gio/tests/tls-certificate.c
@@ -308,6 +308,7 @@ main (int   argc,
   g_free (ref.cert_pems[1]);
   g_free (ref.cert_pems[2]);
   g_free (ref.key_pem);
+  g_free (ref.key8_pem);
 
   return rtv;
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]