girepository: Fix memory leak in g_irepository_get_dependencies()

The transitive_dependencies GHashTable was being leaked.

https://bugzilla.gnome.org/show_bug.cgi?id=758448
This commit is contained in:
Garrett Regier 2015-11-20 23:01:21 -08:00
parent 0f0b325d72
commit 6b55207f25

View File

@ -559,12 +559,12 @@ g_irepository_get_dependencies (GIRepository *repository,
g_return_val_if_fail (namespace != NULL, NULL);
repository = get_repository (repository);
transitive_dependencies = g_hash_table_new_full (g_str_hash, g_str_equal,
g_free, NULL);
/* Load the dependencies. */
typelib = get_registered (repository, namespace, NULL);
g_return_val_if_fail (typelib != NULL, NULL);
/* Load the dependencies. */
transitive_dependencies = g_hash_table_new (g_str_hash, g_str_equal);
get_typelib_dependencies_transitive (repository, typelib,
transitive_dependencies);
@ -579,6 +579,8 @@ g_irepository_get_dependencies (GIRepository *repository,
g_hash_table_iter_steal (&iter);
}
g_hash_table_unref (transitive_dependencies);
/* Add a NULL terminator. */
g_ptr_array_add (out, NULL);