aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilip Withnall <philip.withnall@collabora.co.uk>2013-11-29 19:20:32 +0800
committerMatthew Barnes <mbarnes@redhat.com>2013-12-04 21:18:08 +0800
commit7cb2ed6c67b09ca0f2ece3ca4d56b60e97b5ac6f (patch)
tree71c7f6eb84958f73f74bb4e8a3b2b83ed6b25807
parentea219ed51b6728b2e8fd5927a2496bc36defee0f (diff)
downloadgsoc2013-evolution-7cb2ed6c67b09ca0f2ece3ca4d56b60e97b5ac6f.tar
gsoc2013-evolution-7cb2ed6c67b09ca0f2ece3ca4d56b60e97b5ac6f.tar.gz
gsoc2013-evolution-7cb2ed6c67b09ca0f2ece3ca4d56b60e97b5ac6f.tar.bz2
gsoc2013-evolution-7cb2ed6c67b09ca0f2ece3ca4d56b60e97b5ac6f.tar.lz
gsoc2013-evolution-7cb2ed6c67b09ca0f2ece3ca4d56b60e97b5ac6f.tar.xz
gsoc2013-evolution-7cb2ed6c67b09ca0f2ece3ca4d56b60e97b5ac6f.tar.zst
gsoc2013-evolution-7cb2ed6c67b09ca0f2ece3ca4d56b60e97b5ac6f.zip
pine-importer: Fix a crash when importing with no existing address books
This is a theoretical crash (not actually reproduced), caused by the client variable being NULL if no address books exist. Instead of crashing, gracefully exit with an error. Found by scan-build. https://bugzilla.gnome.org/719540
-rw-r--r--mail/importers/pine-importer.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/mail/importers/pine-importer.c b/mail/importers/pine-importer.c
index f5ae3fdd28..fe636204c4 100644
--- a/mail/importers/pine-importer.c
+++ b/mail/importers/pine-importer.c
@@ -198,6 +198,11 @@ import_contacts (void)
source = E_SOURCE (list->data);
client = e_book_client_connect_sync (source, NULL, &error);
+ } else {
+ /* No address books exist. */
+ g_warning ("%s: No address books exist.", G_STRFUNC);
+ fclose (fp);
+ return;
}
g_list_free_full (list, (GDestroyNotify) g_object_unref);