[gobject-introspection] girepository: Fix leak in write_field_info



commit c0bd13cf682b764601ccf301c682bd166c1bceb3
Author: David King <dking redhat com>
Date:   Thu May 20 12:35:37 2021 +0100

    girepository: Fix leak in write_field_info
    
    Unref type before reusing it. Found by Coverity.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1938731

 girepository/girwriter.c | 1 +
 1 file changed, 1 insertion(+)
---
diff --git a/girepository/girwriter.c b/girepository/girwriter.c
index 7b255423..cc14280b 100644
--- a/girepository/girwriter.c
+++ b/girepository/girwriter.c
@@ -423,6 +423,7 @@ write_field_info (const gchar *namespace,
   if (branch)
     {
       xml_printf (file, " branch=\"");
+      g_base_info_unref ((GIBaseInfo *)type);
       type = g_constant_info_get_type (branch);
       g_constant_info_get_value (branch, &value);
       write_constant_value (namespace, type, &value, file);


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