diff options
author | Federico Mena Quintero <federico@novell.com> | 2006-12-19 19:54:48 +0000 |
---|---|---|
committer | Federico Mena Quintero <federico@src.gnome.org> | 2006-12-19 19:54:48 +0000 |
commit | 111f0449c361fb47b635005da177a080d88819be (patch) | |
tree | 8094777ddfca1bcc695990b5de4ab1b774b6430c | |
parent | f101989220539e8683e2bf14c328b7bef8b43752 (diff) | |
download | nautilus-111f0449c361fb47b635005da177a080d88819be.tar.gz |
Oops, handle the case of an empty domains_hash.
2006-12-19 Federico Mena Quintero <federico@novell.com>
* libnautilus-private/nautilus-debug-log.c
(make_key_file_from_configuration): Oops, handle the case of an
empty domains_hash.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | libnautilus-private/nautilus-debug-log.c | 17 |
2 files changed, 15 insertions, 8 deletions
@@ -1,3 +1,9 @@ +2006-12-19 Federico Mena Quintero <federico@novell.com> + + * libnautilus-private/nautilus-debug-log.c + (make_key_file_from_configuration): Oops, handle the case of an + empty domains_hash. + 2006-12-19 Martin Wehner <martin.wehner@gmail.com> * libnautilus-private/nautilus-file-operations-progress.c: diff --git a/libnautilus-private/nautilus-debug-log.c b/libnautilus-private/nautilus-debug-log.c index b498a8d99..f4ce32047 100644 --- a/libnautilus-private/nautilus-debug-log.c +++ b/libnautilus-private/nautilus-debug-log.c @@ -420,16 +420,17 @@ make_key_file_from_configuration (void) if (domains_hash) { num_domains = g_hash_table_size (domains_hash); + if (num_domains != 0) { + closure.domains = g_new (char *, num_domains); + closure.num_domains = 0; - closure.domains = g_new (char *, num_domains); - closure.num_domains = 0; + g_hash_table_foreach (domains_hash, domains_foreach_dump_cb, &closure); + g_assert (num_domains == closure.num_domains); - g_hash_table_foreach (domains_hash, domains_foreach_dump_cb, &closure); - g_assert (num_domains == closure.num_domains); - - g_key_file_set_string_list (key_file, KEY_FILE_GROUP, KEY_FILE_DOMAINS_KEY, - (const gchar * const *) closure.domains, closure.num_domains); - g_free (closure.domains); + g_key_file_set_string_list (key_file, KEY_FILE_GROUP, KEY_FILE_DOMAINS_KEY, + (const gchar * const *) closure.domains, closure.num_domains); + g_free (closure.domains); + } } /* max lines */ |