diff options
author | Robert McQueen <robot101@debian.org> | 2006-06-07 00:31:01 +0000 |
---|---|---|
committer | Robert McQueen <robot101@debian.org> | 2006-06-07 00:31:01 +0000 |
commit | c23e79fbd7f1bc32f2be082f07f21dd69c02478f (patch) | |
tree | ff1bab6267f47706e354d8113883ae7b300c76a6 | |
parent | 78d7c8d2ae47f9fbad5f5a20da2976a815474a9d (diff) |
2005-05-06 Robert McQueen <robot101@debian.org>
* glib/dbus-gtype-specialized.c: Fix obvious leak of GArray in every
call to dbus_g_type_get_struct.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | glib/dbus-gtype-specialized.c | 9 |
2 files changed, 12 insertions, 2 deletions
@@ -1,5 +1,10 @@ 2005-05-06 Robert McQueen <robot101@debian.org> + * glib/dbus-gtype-specialized.c: Fix obvious leak of GArray in every + call to dbus_g_type_get_struct. + +2005-05-06 Robert McQueen <robot101@debian.org> + * glib/dbus-gvalue-utils.c: Fix the failing test where static string pointers were put into a GPtrArray-based specialised collection, and then freed along with the array. GValues which you add into diff --git a/glib/dbus-gtype-specialized.c b/glib/dbus-gtype-specialized.c index 338e49d..3e39c49 100644 --- a/glib/dbus-gtype-specialized.c +++ b/glib/dbus-gtype-specialized.c @@ -392,7 +392,7 @@ dbus_g_type_get_struct (const char *container, ...) { GArray *types; - GType curtype; + GType curtype, ret; va_list args; va_start (args, first_type); @@ -404,8 +404,13 @@ dbus_g_type_get_struct (const char *container, curtype = va_arg (args, GType); } va_end (args); - return lookup_or_register_specialized (container, types->len, (GType*)types->data); + ret = lookup_or_register_specialized (container, types->len, + (GType *) types->data); + + g_array_free (types, TRUE); + + return ret; } |