[gobject-introspection] Fix possible leak of transitive dependency name.



commit 763d054d971e331e06649b33c78b5d5c85a5e224
Author: Elliott Sales de Andrade <quantum analyst gmail com>
Date:   Thu Jan 31 16:44:13 2019 -0500

    Fix possible leak of transitive dependency name.
    
    If a transitive dependency appears twice, the original pointer will be
    removed from the hash table. Since these names were created by
    g_strsplit, they need to be freed, or they will leak.

 girepository/girepository.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/girepository/girepository.c b/girepository/girepository.c
index 77ba8ed5..bc9e4ed5 100644
--- a/girepository/girepository.c
+++ b/girepository/girepository.c
@@ -562,7 +562,8 @@ g_irepository_get_dependencies (GIRepository *repository,
   g_return_val_if_fail (typelib != NULL, NULL);
 
   /* Load the dependencies. */
-  transitive_dependencies = g_hash_table_new (g_str_hash, g_str_equal);
+  transitive_dependencies = g_hash_table_new_full (g_str_hash, g_str_equal,
+                                                   g_free, NULL);
   get_typelib_dependencies_transitive (repository, typelib,
                                        transitive_dependencies);
 


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