[PATCH 17/18] Fix some valgrind warnings in camel imap provider.



Fix some valgrind warnings in camel imap provider.

---
 .../camel/providers/imap/camel-imap-folder.c       |    5 +++--
 .../providers/imap/camel-imap-message-cache.c      |    5 +++++
 2 files changed, 8 insertions(+), 2 deletions(-)

--
Rob Taylor, Codethink Ltd. - http://codethink.co.uk
diff --git a/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-folder.c b/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-folder.c
index 2bc266e..8559e42 100644
--- a/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-folder.c
+++ b/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-folder.c
@@ -834,9 +834,10 @@ imap_finalize (CamelObject *object)
 	if (imap_folder->cache)
 		camel_object_unref (CAMEL_OBJECT (imap_folder->cache));
 
-	if (imap_folder->folder_dir)
+	if (imap_folder->folder_dir){
 		g_free (imap_folder->folder_dir);
-
+		imap_folder->folder_dir = NULL;
+	}
 
 #ifdef ENABLE_THREADS
 	g_static_mutex_free(&imap_folder->priv->search_lock);
diff --git a/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-message-cache.c b/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-message-cache.c
index bd09e6a..ac85cd2 100644
--- a/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-message-cache.c
+++ b/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-message-cache.c
@@ -347,6 +347,11 @@ void
 camel_imap_message_cache_set_flags (const gchar *folder_dir, CamelMessageInfoBase *mi)
 {
 	char mystring [512];
+
+	if( !folder_dir ){
+		return;
+	}
+
 	snprintf (mystring, 512, "%s/%s.", folder_dir, mi->uid);
 	if (g_file_test (mystring, G_FILE_TEST_IS_REGULAR))
 	{



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]