All of the folders were added to a hash table with a non-strduped string as a
key, but then if the parent folder was missing, we created a new folderinfo for
the parent and inserted that into the hash table with a strduped key. So when
the hash table was destroyed, the 'fake' parent folder keys were leaked. To fix
this, I created the hash table with g_hash_table_new_full() which would g_free()
the keys and then always strduped the key.
https://bugzilla.gnome.org/show_bug.cgi?id=607588
qsort (folders->pdata, folders->len, sizeof (folders->pdata[0]), folder_info_cmp);
/* Hash the folders. */
- hash = g_hash_table_new (g_str_hash, g_str_equal);
+ hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
for (i = 0; i < folders->len; i++) {
fi = folders->pdata[i];
- g_hash_table_insert (hash, fi->full_name, fi);
+ g_hash_table_insert (hash, g_strdup (fi->full_name), fi);
}
/* Now find parents. */