From 1da728ffa1d15a9c85d7bb85b2947134bafeb8ea Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Sat, 25 Aug 2012 04:05:17 -0300 Subject: girepository: Fix leak in g_vfunc_info_get_address We need to fix the struct info here. https://bugzilla.gnome.org/show_bug.cgi?id=682647 --- girepository/givfuncinfo.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/girepository/givfuncinfo.c b/girepository/givfuncinfo.c index f9ba64a7..9d6ea39d 100644 --- a/girepository/givfuncinfo.c +++ b/girepository/givfuncinfo.c @@ -220,7 +220,8 @@ g_vfunc_info_get_address (GIVFuncInfo *vfunc_info, GIStructInfo *struct_info; GIFieldInfo *field_info = NULL; int length, i, offset; - gpointer implementor_vtable, func; + gpointer implementor_vtable; + gpointer func = NULL; object_info = (GIObjectInfo *) g_base_info_get_container (vfunc_info); struct_info = g_object_info_get_class_struct (object_info); @@ -246,7 +247,7 @@ g_vfunc_info_get_address (GIVFuncInfo *vfunc_info, G_INVOKE_ERROR, G_INVOKE_ERROR_SYMBOL_NOT_FOUND, "Couldn't find struct field for this vfunc"); - return NULL; + goto out; } implementor_vtable = g_type_class_ref (implementor_gtype); @@ -263,9 +264,12 @@ g_vfunc_info_get_address (GIVFuncInfo *vfunc_info, "Class %s doesn't implement %s", g_type_name (implementor_gtype), g_base_info_get_name ( (GIBaseInfo*) vfunc_info)); - return NULL; + goto out; } + out: + g_base_info_unref ((GIBaseInfo*) struct_info); + return func; } -- cgit v1.2.1