[gobject-introspection] girepository: Fix leak in g_callable_info_invoke
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gobject-introspection] girepository: Fix leak in g_callable_info_invoke
- Date: Sun, 20 Jun 2021 21:25:46 +0000 (UTC)
commit 91ce47665818eae63d3f32185dd6c18d5a9a0b34
Author: David King <dking redhat com>
Date: Thu May 20 11:24:14 2021 +0100
girepository: Fix leak in g_callable_info_invoke
Found by Coverity.
https://bugzilla.redhat.com/show_bug.cgi?id=1938731
girepository/gicallableinfo.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/girepository/gicallableinfo.c b/girepository/gicallableinfo.c
index 3048e162..16e391f9 100644
--- a/girepository/gicallableinfo.c
+++ b/girepository/gicallableinfo.c
@@ -638,6 +638,7 @@ g_callable_info_invoke (GIFunctionInfo *info,
case GI_DIRECTION_IN:
tinfo = g_arg_info_get_type (ainfo);
atypes[i+offset] = g_type_info_get_ffi_type (tinfo);
+ g_base_info_unref ((GIBaseInfo *)ainfo);
g_base_info_unref ((GIBaseInfo *)tinfo);
if (in_pos >= n_in_args)
@@ -655,6 +656,7 @@ g_callable_info_invoke (GIFunctionInfo *info,
break;
case GI_DIRECTION_OUT:
atypes[i+offset] = &ffi_type_pointer;
+ g_base_info_unref ((GIBaseInfo *)ainfo);
if (out_pos >= n_out_args)
{
@@ -670,6 +672,7 @@ g_callable_info_invoke (GIFunctionInfo *info,
break;
case GI_DIRECTION_INOUT:
atypes[i+offset] = &ffi_type_pointer;
+ g_base_info_unref ((GIBaseInfo *)ainfo);
if (in_pos >= n_in_args)
{
@@ -694,9 +697,9 @@ g_callable_info_invoke (GIFunctionInfo *info,
out_pos++;
break;
default:
+ g_base_info_unref ((GIBaseInfo *)ainfo);
g_assert_not_reached ();
}
- g_base_info_unref ((GIBaseInfo *)ainfo);
}
if (throws)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]