[gobject-introspection] girepository: Fix leak in write_vfunc_info



commit f3b8d2771dc9689a3e8a9f1a34337992946d7a84
Author: David King <dking redhat com>
Date:   Thu May 20 12:40:23 2021 +0100

    girepository: Fix leak in write_vfunc_info
    
    Found by Coverity.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1938731

 girepository/girwriter.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/girepository/girwriter.c b/girepository/girwriter.c
index cc14280b..d092df10 100644
--- a/girepository/girwriter.c
+++ b/girepository/girwriter.c
@@ -923,7 +923,10 @@ write_vfunc_info (const gchar *namespace,
   xml_printf (file, " offset=\"%d\"", offset);
 
   if (invoker)
-    xml_printf (file, " invoker=\"%s\"", g_base_info_get_name ((GIBaseInfo*)invoker));
+    {
+      xml_printf (file, " invoker=\"%s\"", g_base_info_get_name ((GIBaseInfo*)invoker));
+      g_base_info_unref ((GIBaseInfo *)invoker);
+    }
 
   write_callable_info (namespace, (GICallableInfo*)info, file);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]