+2008-08-06 Milan Crha <mcrha@redhat.com>
+
+ ** Part of fix for bug #546397
+
+ * camel-store.c: (construct): Do not use NULL in g_file_test.
+ * camel-folder-search.c: (read_uid_callback): Cast to right type.
+ * camel-folder-summary.c: (camel_folder_summary_remove_range):
+ Do not leak objects from loaded_infos array.
+
2008-08-05 Chenthill Palanisamy <pchenthill@novell.com>
Fixes part of #533823
matches = (GPtrArray *) ref;
- g_ptr_array_add (matches, (GFunc) camel_pstring_strdup (cols [0]));
+ g_ptr_array_add (matches, (gpointer) camel_pstring_strdup (cols [0]));
return 0;
}
for (i = start; i < end; i++) {
const char *uid = s->uids->pdata[i];
+ gpointer olduid, oldinfo;
+ /* the uid will be freed below and will not be used because of changing size of the s->uids array */
uids = g_slist_prepend (uids, (gpointer) uid);
- g_hash_table_remove(s->loaded_infos, uid);
+ if (g_hash_table_lookup_extended (s->loaded_infos, uid, &olduid, &oldinfo)) {
+ camel_message_info_free (oldinfo);
+ g_hash_table_remove (s->loaded_infos, uid);
+ }
}
camel_exception_init (&ex);
CamelException *ex)
{
CamelStore *store = CAMEL_STORE(service);
- char *store_db_path;
+ char *store_db_path, *store_path = NULL;
parent_class->construct(service, session, provider, url, ex);
if (camel_exception_is_set (ex))
store_db_path = g_build_filename (service->url->path, CAMEL_DB_FILE, NULL);
- if (strlen (store_db_path) < 2) {
- char *store_path = camel_session_get_storage_path (session, service, ex);
+ if (!service->url->path || strlen (store_db_path) < 2) {
+ store_path = camel_session_get_storage_path (session, service, ex);
g_free (store_db_path);
store_db_path = g_build_filename (store_path, CAMEL_DB_FILE, NULL);
- g_free (store_path);
}
- if (!g_file_test(service->url->path, G_FILE_TEST_EXISTS)) {
+ if (!g_file_test (service->url->path ? service->url->path : store_path, G_FILE_TEST_EXISTS)) {
/* Cache might be blown. Recreate. */
- g_mkdir_with_parents (service->url->path, S_IRWXU);
+ g_mkdir_with_parents (service->url->path ? service->url->path : store_path, S_IRWXU);
}
+ g_free (store_path);
+
store->cdb = camel_db_open (store_db_path, ex);
printf("store_db_path %s\n", store_db_path);
if (camel_exception_is_set (ex)) {
+2008-08-06 Milan Crha <mcrha@redhat.com>
+
+ ** Part of fix for bug #546397
+
+ * camel-nntp-folder.c: (nntp_folder_search_free):
+ Guard access to 'search' member with its lock.
+
2008-08-01 Matthew Barnes <mbarnes@redhat.com>
* camel-nntp-store-summary.c:
nntp_folder_search_free (CamelFolder *folder, GPtrArray *result)
{
CamelNNTPFolder *nntp_folder = CAMEL_NNTP_FOLDER (folder);
-
+
+ CAMEL_NNTP_FOLDER_LOCK(nntp_folder, search_lock);
camel_folder_search_free_result (nntp_folder->search, result);
+ CAMEL_NNTP_FOLDER_UNLOCK(nntp_folder, search_lock);
}
static void