aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/pst-import/pst-importer.c
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2013-11-15 16:06:57 +0800
committerMilan Crha <mcrha@redhat.com>2013-11-15 16:06:57 +0800
commit570c6374806d0f1ec59cf7a72543efe6b5b637be (patch)
treec5390b1fcb73f30c28bf37168add9bf1dc622b42 /plugins/pst-import/pst-importer.c
parent1be51f232560f864ba8795a38e55d472b5b0e2b3 (diff)
downloadgsoc2013-evolution-570c6374806d0f1ec59cf7a72543efe6b5b637be.tar
gsoc2013-evolution-570c6374806d0f1ec59cf7a72543efe6b5b637be.tar.gz
gsoc2013-evolution-570c6374806d0f1ec59cf7a72543efe6b5b637be.tar.bz2
gsoc2013-evolution-570c6374806d0f1ec59cf7a72543efe6b5b637be.tar.lz
gsoc2013-evolution-570c6374806d0f1ec59cf7a72543efe6b5b637be.tar.xz
gsoc2013-evolution-570c6374806d0f1ec59cf7a72543efe6b5b637be.tar.zst
gsoc2013-evolution-570c6374806d0f1ec59cf7a72543efe6b5b637be.zip
Fix/mute issues found by Coverity scan
This makes the code free of Coverity scan issues. It is sometimes quite pedantic and expects/suggests some coding habits, thus certain changes may look weird, but for a good thing, I hope. The code is also tagged with Coverity scan suppressions, to keep the code as is and hide the warning too. Also note that Coverity treats g_return_if_fail(), g_assert() and similar macros as unreliable, and it's true these can be disabled during the compile time, thus it brings in other set of 'weird' changes.
Diffstat (limited to 'plugins/pst-import/pst-importer.c')
-rw-r--r--plugins/pst-import/pst-importer.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/plugins/pst-import/pst-importer.c b/plugins/pst-import/pst-importer.c
index 853a16cbd8..f16f476920 100644
--- a/plugins/pst-import/pst-importer.c
+++ b/plugins/pst-import/pst-importer.c
@@ -807,13 +807,14 @@ pst_import_folders (PstImporter *m,
pst_desc_tree *topitem)
{
GHashTable *node_to_folderuri; /* pointers of hierarchy nodes, to them associated folder uris */
- pst_desc_tree *d_ptr;
+ pst_desc_tree *d_ptr = NULL;
node_to_folderuri = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, g_free);
- d_ptr = topitem->child;
- if (topitem)
+ if (topitem) {
+ d_ptr = topitem->child;
g_hash_table_insert (node_to_folderuri, topitem, g_strdup (m->folder_uri));
+ }
/* Walk through folder tree */
while (d_ptr != NULL && (g_cancellable_is_cancelled (m->cancellable) == FALSE)) {
@@ -866,7 +867,7 @@ pst_import_folders (PstImporter *m,
break;
}
- d_ptr = d_ptr->next;
+ d_ptr = d_ptr ? d_ptr->next : NULL;
}
g_free (previous_folder);
@@ -1865,6 +1866,8 @@ fill_calcomponent (PstImporter *m,
case PST_FREEBUSY_FREE:
/* mark as transparent and as confirmed */
e_cal_component_set_transparency (ec, E_CAL_COMPONENT_TRANSP_TRANSPARENT);
+ e_cal_component_set_status (ec, ICAL_STATUS_CONFIRMED);
+ break;
case PST_FREEBUSY_BUSY:
case PST_FREEBUSY_OUT_OF_OFFICE:
e_cal_component_set_status (ec, ICAL_STATUS_CONFIRMED);