summaryrefslogtreecommitdiffstats
path: root/glib
diff options
context:
space:
mode:
authorRobert McQueen <robot101@debian.org>2006-06-07 00:31:01 +0000
committerRobert McQueen <robot101@debian.org>2006-06-07 00:31:01 +0000
commit781a7bc4399365f4613a883d974bf967d1b3046e (patch)
tree869a1ba541840128162399057184f590817695f5 /glib
parentbc4bb30c8ff5b07ce4452b5e6cbd95a4c710d3c3 (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.
Diffstat (limited to 'glib')
-rw-r--r--glib/dbus-gtype-specialized.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/glib/dbus-gtype-specialized.c b/glib/dbus-gtype-specialized.c
index 338e49d0..3e39c49d 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;
}