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.
This commit is contained in:
Elliott Sales de Andrade 2019-01-31 16:44:13 -05:00
parent 4c0a8388d5
commit d17edde568

View File

@ -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);