summaryrefslogtreecommitdiff
path: root/girepository/giobjectinfo.c
diff options
context:
space:
mode:
authorPavel Holejsovsky <pavel.holejsovsky@gmail.com>2012-03-31 19:12:48 +0200
committerPavel Holejsovsky <pholejs@src.gnome.org>2012-04-07 18:13:23 +0200
commit5fda6c30954e46c95eaf46370a4266c81afea6a2 (patch)
tree36f9ca6b9a5cb46acad2f9d4de139497bce4b4e5 /girepository/giobjectinfo.c
parent4019e078b3f20872cc11b70ae4686ce5f74c1bb9 (diff)
downloadgobject-introspection-5fda6c30954e46c95eaf46370a4266c81afea6a2.tar.gz
Avoid _get_func() consuming reference from input info
Fix of leak in 4c9424e18d71237f438a99bc5f2d45ae7de60b78 was a bit overaggressive, stealing also one reference from input 'info' argument. Also fixes another bug in that commit - local 'func' shadowing the return value, causing that function always returned NULL even when some result was actually found. https://bugzilla.gnome.org/show_bug.cgi?id=673282
Diffstat (limited to 'girepository/giobjectinfo.c')
-rw-r--r--girepository/giobjectinfo.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/girepository/giobjectinfo.c b/girepository/giobjectinfo.c
index 3b8f64bb..7ba2a93b 100644
--- a/girepository/giobjectinfo.c
+++ b/girepository/giobjectinfo.c
@@ -819,7 +819,7 @@ _get_func(GIObjectInfo *info,
GIObjectInfo *parent_info;
gpointer func = NULL;
- parent_info = info;
+ parent_info = g_base_info_ref (info);
while (parent_info != NULL)
{
parents = g_slist_prepend (parents, parent_info);
@@ -828,7 +828,6 @@ _get_func(GIObjectInfo *info,
for (l = parents; l; l = l->next)
{
- GIObjectInfoRefFunction func;
parent_info = l->data;
symbol = getter (parent_info);
if (symbol == NULL)