tests: Fix memory leak in gi_marshalling_tests_ghashtable_utf8_full_return
authorMartin Pitt <martinpitt@gnome.org>
Mon, 4 Mar 2013 10:14:44 +0000 (11:14 +0100)
committerMartin Pitt <martinpitt@gnome.org>
Mon, 4 Mar 2013 10:14:44 +0000 (11:14 +0100)
For the "transfer full" case we need to supply free functions for the created
hash table in gi_marshalling_tests_ghashtable_utf8_full_return().

tests/gimarshallingtests.c

index dc7fabd63911f36119d217a2bd913b6929ceca5d..f6fd630a9cf77ecc9a97a244b22c0193d8f3c5e7 100644 (file)
@@ -2933,7 +2933,7 @@ gi_marshalling_tests_ghashtable_utf8_full_return (void)
 {
   GHashTable *hash_table = NULL;
 
-  hash_table = g_hash_table_new (g_str_hash, g_str_equal);
+  hash_table = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
   g_hash_table_insert (hash_table, g_strdup ("-1"), g_strdup ("1"));
   g_hash_table_insert (hash_table, g_strdup ("0"), g_strdup ("0"));
   g_hash_table_insert (hash_table, g_strdup ("1"), g_strdup ("-1"));