summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasper St. Pierre <jstpierre@mecheye.net>2012-08-25 04:05:17 -0300
committerJasper St. Pierre <jstpierre@mecheye.net>2012-08-25 14:10:06 -0300
commit1da728ffa1d15a9c85d7bb85b2947134bafeb8ea (patch)
treec1d388d57bd0cee5b9320e175ca35c9609961a51
parente80aedca29dc511e5c41cf4f13a34018e6f08be7 (diff)
downloadgobject-introspection-1da728ffa1d15a9c85d7bb85b2947134bafeb8ea.tar.gz
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
-rw-r--r--girepository/givfuncinfo.c10
1 files 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;
}