[glib] Plug a mem leak in the gdbus-proxy test



commit db4fb1b115b2cd4142454db64da2b0abfedcd31b
Author: Christian Persch <chpe gnome org>
Date:   Fri Sep 3 16:05:28 2010 -0400

    Plug a mem leak in the gdbus-proxy test
    
    ==23341== 65 bytes in 3 blocks are definitely lost in loss record 927 of 1,020
    ==23341==    at 0x4005BDC: malloc (vg_replace_malloc.c:195)
    ==23341==    by 0x4057094: g_malloc (gmem.c:134)
    ==23341==    by 0x40573DB: g_malloc_n (gmem.c:281)
    ==23341==    by 0x40717FC: g_strdup (gstrfuncs.c:101)
    ==23341==    by 0x4147F56: value_lcopy_string (gvaluetypes.c:313)
    ==23341==    by 0x4123F0B: g_object_get_valist (gobject.c:1643)
    ==23341==    by 0x41240FF: g_object_get (gobject.c:1731)
    ==23341==    by 0x804C39E: test_basic (gdbus-proxy.c:522)
    
    Bug #628331.

 gio/tests/gdbus-proxy.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/gio/tests/gdbus-proxy.c b/gio/tests/gdbus-proxy.c
index 6b663a7..142476f 100644
--- a/gio/tests/gdbus-proxy.c
+++ b/gio/tests/gdbus-proxy.c
@@ -505,9 +505,9 @@ test_basic (GDBusProxy *proxy)
   GDBusConnection *conn;
   GDBusProxyFlags flags;
   GDBusInterfaceInfo *info;
-  const gchar *name;
-  const gchar *path;
-  const gchar *interface;
+  gchar *name;
+  gchar *path;
+  gchar *interface;
   gint timeout;
 
   connection = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, NULL);
@@ -539,6 +539,9 @@ test_basic (GDBusProxy *proxy)
   g_assert_cmpint (timeout, ==, -1);
 
   g_object_unref (conn);
+  g_free (name);
+  g_free (path);
+  g_free (interface);
 
   g_object_unref (connection);
 }



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