modified_something = TRUE;
last_item = nmi->folder;
}
- procmsg_msginfo_free (nmi);
+ procmsg_msginfo_free (&nmi);
if (summaryview && summaryview->displayed &&
summaryview->folder_item == msginfo->folder &&
summary_get_msgnum(summaryview, summaryview->displayed) == msginfo->msgnum)
}
}
- procmsg_msginfo_free( dummyinfo );
+ procmsg_msginfo_free( &dummyinfo );
if (attach_files) {
GList *curr;
quote_fmt_reset_vartable();
g_free(tmp);
- procmsg_msginfo_free(full_msginfo);
+ procmsg_msginfo_free(&full_msginfo);
}
textview = GTK_TEXT_VIEW(compose->text);
quote_fmt_reset_vartable();
compose_attach_parts(compose, msginfo);
- procmsg_msginfo_free(full_msginfo);
+ procmsg_msginfo_free(&full_msginfo);
}
SIGNAL_BLOCK(textbuf);
ok:
SIGNAL_UNBLOCK(buffer);
- procmsg_msginfo_free( dummyinfo );
+ procmsg_msginfo_free( &dummyinfo );
return buf;
}
ainfo->name = g_strdup_printf(_("Message: %s"), name);
- procmsg_msginfo_free(msginfo);
+ procmsg_msginfo_free(&msginfo);
} else {
if (!g_ascii_strncasecmp(content_type, "text/", 5)) {
ainfo->charset = g_strdup(charset);
if (tmp) {
debug_print("removing %d via %s\n", tmp->msgnum, tmsgid);
folder_item_remove_msg(folder, tmp->msgnum);
- procmsg_msginfo_free(tmp);
+ procmsg_msginfo_free(&tmp);
}
}
}
if (tmp) {
debug_print("removing %d via %s\n", tmp->msgnum, tmsgid);
folder_item_remove_msg(folder, tmp->msgnum);
- procmsg_msginfo_free(tmp);
+ procmsg_msginfo_free(&tmp);
}
}
if (!discard_window) {
parsed_str = compose_quote_fmt(compose, dummyinfo,
tmpl->value, qmark, tmp, FALSE, FALSE, err_msg);
- procmsg_msginfo_free( dummyinfo );
+ procmsg_msginfo_free( &dummyinfo );
g_free( tmp );
}
}
}
- procmsg_msginfo_free( dummyinfo );
+ procmsg_msginfo_free( &dummyinfo );
}
static void compose_destroy(Compose *compose)
hooks_unregister_hook(FOLDER_UPDATE_HOOKLIST,
compose->folder_update_callback_id);
- procmsg_msginfo_free(compose->targetinfo);
- procmsg_msginfo_free(compose->replyinfo);
- procmsg_msginfo_free(compose->fwdinfo);
+ procmsg_msginfo_free(&(compose->targetinfo));
+ procmsg_msginfo_free(&(compose->replyinfo));
+ procmsg_msginfo_free(&(compose->fwdinfo));
g_free(compose->replyto);
g_free(compose->cc);
}
if (tmpinfo) {
msgnum = tmpinfo->msgnum;
- procmsg_msginfo_free(tmpinfo);
+ procmsg_msginfo_free(&tmpinfo);
debug_print("got draft msgnum %d from scanning\n", msgnum);
} else {
debug_print("didn't get draft msgnum after scanning\n");
if (action == COMPOSE_DRAFT_FOR_EXIT) {
compose_register_draft(newmsginfo);
}
- procmsg_msginfo_free(newmsginfo);
+ procmsg_msginfo_free(&newmsginfo);
}
folder_item_scan(draft);
}
g_free(path);
- procmsg_msginfo_free(compose->targetinfo);
+ procmsg_msginfo_free(&(compose->targetinfo));
compose->targetinfo = procmsg_msginfo_new();
compose->targetinfo->msgnum = msgnum;
compose->targetinfo->size = (goffset)s.st_size;
if (new_msglist) {
compose = compose_reply_mode((ComposeMode)action, new_msglist, body);
- procmsg_msginfo_free(tmp_msginfo);
+ procmsg_msginfo_free(&tmp_msginfo);
g_slist_free(new_msglist);
} else
compose = compose_reply_mode((ComposeMode)action, msginfo_list, body);
ret = syncronize_flags(item, msglist);
- for (cur = msglist; cur != NULL; cur = g_slist_next(cur))
- procmsg_msginfo_free((MsgInfo *) cur->data);
+ for (cur = msglist; cur != NULL; cur = g_slist_next(cur)) {
+ procmsg_msginfo_free((MsgInfo **)&(cur->data));
+ }
g_slist_free(msglist);
msginfo = (MsgInfo *) cur->data;
if (MSG_IS_NEW(msginfo->flags))
procmsg_msginfo_unset_flags(msginfo, MSG_NEW, 0);
- procmsg_msginfo_free(msginfo);
+ procmsg_msginfo_free(&msginfo);
}
g_slist_free(mlist);
folder_item_update_thaw();
if (msginfo && folder->klass->is_msg_changed && folder->klass->is_msg_changed(folder, item, msginfo)) {
msgcache_remove_msg(item->cache, msginfo->msgnum);
new_list = g_slist_prepend(new_list, GINT_TO_POINTER(msginfo->msgnum));
- procmsg_msginfo_free(msginfo);
+ procmsg_msginfo_free(&msginfo);
debug_print("Remembering message %d to update...\n", folder_cur_num);
} else if (msginfo) {
}
for(cache_list_cur = cache_list; cache_list_cur != NULL; cache_list_cur = g_slist_next(cache_list_cur))
- procmsg_msginfo_free((MsgInfo *) cache_list_cur->data);
+ procmsg_msginfo_free((MsgInfo **)&(cache_list_cur->data));
g_slist_free(cache_list);
g_slist_free(folder_list);
if (to_filter != NULL) {
for (elem = to_filter; elem; elem = g_slist_next(elem)) {
MsgInfo *msginfo = (MsgInfo *)elem->data;
- procmsg_msginfo_free(msginfo);
+ procmsg_msginfo_free(&msginfo);
}
g_slist_free(to_filter);
}
totalcnt++;
- procmsg_msginfo_free(msginfo);
+ procmsg_msginfo_free(&msginfo);
}
folder_item_set_batch(item, FALSE);
g_slist_free(exists_list);
procmsg_msginfo_set_flags(msginfo, 0, MSG_SCANNED);
}
}
- procmsg_msginfo_free(msginfo);
+ procmsg_msginfo_free(&msginfo);
}
return msgfile;
procmsg_msginfo_set_flags(msginfo, 0, MSG_SCANNED);
}
}
- procmsg_msginfo_free(msginfo);
+ procmsg_msginfo_free(&msginfo);
}
return msgfile;
remove_space(hentry[0].body);
if ((msginfo = msgcache_get_msg_by_id(dest->cache, hentry[0].body)) != NULL) {
msgnum = msginfo->msgnum;
- procmsg_msginfo_free(msginfo);
+ procmsg_msginfo_free(&msginfo);
debug_print("found message as uid %d\n", msgnum);
}
if (!folderscan &&
((newmsginfo = get_msginfo(dest, num)) != NULL)) {
add_msginfo_to_cache(dest, newmsginfo, NULL);
- procmsg_msginfo_free(newmsginfo);
+ procmsg_msginfo_free(&newmsginfo);
} else if ((newmsginfo = msgcache_get_msg(dest->cache, num)) != NULL) {
/* TODO: set default flags */
- procmsg_msginfo_free(newmsginfo);
+ procmsg_msginfo_free(&newmsginfo);
}
}
}
hooks_invoke (MAIL_POSTFILTERING_HOOKLIST, newmsginfo);
}
}
- procmsg_msginfo_free(newmsginfo);
+ procmsg_msginfo_free(&newmsginfo);
if (num > lastnum)
msginfo = msgcache_get_msg(item->cache, num);
if (msginfo && MSG_IS_LOCKED(msginfo->flags)) {
- procmsg_msginfo_free(msginfo);
+ procmsg_msginfo_free(&msginfo);
return -1;
}
ret = folder->klass->remove_msg(folder, item, num);
if (msginfo != NULL) {
if (ret == 0)
remove_msginfo_from_cache(item, msginfo);
- procmsg_msginfo_free(msginfo);
+ procmsg_msginfo_free(&msginfo);
}
}
|| post_global_processing)
filtering_move_and_copy_msgs(mlist);
for (cur = mlist ; cur != NULL ; cur = cur->next) {
- MsgInfo * msginfo = (MsgInfo *)cur->data;
- procmsg_msginfo_free(msginfo);
+ procmsg_msginfo_free((MsgInfo **)&(cur->data));
}
g_slist_free(mlist);
for (cur = msglist; cur != NULL; cur = g_slist_next(cur)) {
MsgInfo *msginfo = (MsgInfo *) cur->data;
- procmsg_msginfo_free(msginfo);
+ procmsg_msginfo_free(&msginfo);
}
g_slist_free(msglist);
m++;
}
i++;
- procmsg_msginfo_free(msginfo);
+ procmsg_msginfo_free(&msginfo);
}
folder_item_set_batch(item, FALSE);
folder_item_close(item);
have_size, cached->size);
procmsg_msginfo_set_flags(cached, MSG_FULLY_CACHED, 0);
}
- procmsg_msginfo_free(cached);
+ procmsg_msginfo_free(&cached);
return filename;
} else if (!cached && time(NULL) - get_file_mtime(filename) < 60) {
debug_print("message not cached and file recent, considering file complete\n");
if (ok == 0)
return filename;
} else {
- procmsg_msginfo_free(cached);
+ procmsg_msginfo_free(&cached);
}
}
if (cached && MSG_IS_FULLY_CACHED(cached->flags)) {
- procmsg_msginfo_free(cached);
+ procmsg_msginfo_free(&cached);
return filename;
}
} else {
MsgInfo *cached = msgcache_get_msg(item->cache,uid);
if (cached) {
procmsg_msginfo_unset_flags(cached, MSG_FULLY_CACHED, 0);
- procmsg_msginfo_free(cached);
+ procmsg_msginfo_free(&cached);
}
}
MsgInfo *cached = msgcache_get_msg(item->cache,uid);
if (cached) {
procmsg_msginfo_set_flags(cached, MSG_FULLY_CACHED, 0);
- procmsg_msginfo_free(cached);
+ procmsg_msginfo_free(&cached);
}
} else if (ok == -1) {
MsgInfo *cached = msgcache_get_msg(item->cache,uid);
if (cached) {
procmsg_msginfo_unset_flags(cached, MSG_FULLY_CACHED, 0);
- procmsg_msginfo_free(cached);
+ procmsg_msginfo_free(&cached);
}
}
return filename;
return FALSE;
if (MSG_IS_FULLY_CACHED(cached->flags)) {
- procmsg_msginfo_free(cached);
+ procmsg_msginfo_free(&cached);
return TRUE;
}
if (cached && size >= cached->size) {
cached->total_size = cached->size;
procmsg_msginfo_set_flags(cached, MSG_FULLY_CACHED, 0);
- procmsg_msginfo_free(cached);
+ procmsg_msginfo_free(&cached);
return TRUE;
}
if (cached)
- procmsg_msginfo_free(cached);
+ procmsg_msginfo_free(&cached);
return FALSE;
}
data->full_search = TRUE;
for (cur = tmp; cur; cur = cur->next)
- procmsg_msginfo_free((MsgInfo *)cur->data);
+ procmsg_msginfo_free((MsgInfo **)&(cur->data));
g_slist_free(tmp);
for(msglist_element = msglist; msglist_element != NULL;
msglist_element = msglist_element->next) {
MsgInfo *msginfo = (MsgInfo *)msglist_element->data;
- procmsg_msginfo_free(msginfo);
+ procmsg_msginfo_free((MsgInfo**)&(msglist_element->data));
}
folder_item_update_thaw();
folderview_select(mainwin->folderview, info->folder);
summary_display_by_msgnum(mainwin->summaryview, info->msgnum);
summary_display_msg_selected(mainwin->summaryview, FALSE);
- procmsg_msginfo_free(info);
+ procmsg_msginfo_free(&info);
main_window_set_menu_sensitive(mainwindow_get_mainwindow());
toolbar_main_set_sensitive(mainwindow_get_mainwindow());
}
if (info->folder != mainwin->summaryview->folder_item)
folderview_select(mainwin->folderview, info->folder);
summary_display_by_msgnum(mainwin->summaryview, info->msgnum);
- procmsg_msginfo_free(info);
+ procmsg_msginfo_free(&info);
main_window_set_menu_sensitive(mainwindow_get_mainwindow());
toolbar_main_set_sensitive(mainwindow_get_mainwindow());
}
if (popup)
main_window_popup(mainwin);
g_free(tmp);
- procmsg_msginfo_free(msginfo);
+ procmsg_msginfo_free(&msginfo);
return;
} else {
g_print("'%s' not found\n", msg);
filtering_move_and_copy_msgs(to_filter);
for (cur = filtered; cur; cur = g_slist_next(cur)) {
MsgInfo *info = (MsgInfo *)cur->data;
- procmsg_msginfo_free(info);
+ procmsg_msginfo_free(&info);
}
unfiltered = g_slist_reverse(unfiltered);
folder_item_move_msgs(dest, unfiltered);
for (cur = unfiltered; cur; cur = g_slist_next(cur)) {
MsgInfo *info = (MsgInfo *)cur->data;
- procmsg_msginfo_free(info);
+ procmsg_msginfo_free(&info);
}
}
}
if (messageview->msginfo != msginfo) {
- procmsg_msginfo_free(messageview->msginfo);
+ procmsg_msginfo_free(&(messageview->msginfo));
messageview->msginfo = NULL;
messageview_set_menu_sensitive(messageview);
messageview->msginfo =
{
if (!messageview)
return;
- procmsg_msginfo_free(messageview->msginfo);
+ procmsg_msginfo_free(&(messageview->msginfo));
messageview->msginfo = NULL;
messageview->filtered = FALSE;
mimeview_destroy(messageview->mimeview);
noticeview_destroy(messageview->noticeview);
- procmsg_msginfo_free(messageview->msginfo);
+ procmsg_msginfo_free(&(messageview->msginfo));
toolbar_clear_list(TOOLBAR_MSGVIEW);
if (messageview->toolbar) {
toolbar_destroy(messageview->toolbar);
noticeview_hide(noticeview);
}
- procmsg_msginfo_free(tmpmsginfo);
+ procmsg_msginfo_free(&tmpmsginfo);
g_free(file);
}
messageview_show(messageview, info,
messageview->all_headers);
messageview->updating = FALSE;
- procmsg_msginfo_free(info);
+ procmsg_msginfo_free(&info);
if (messageview->deferred_destroy) {
debug_print("messageview got away!\n");
messageview_destroy(messageview);
messageview_show(messageview, info,
messageview->all_headers);
messageview->updating = FALSE;
- procmsg_msginfo_free(info);
+ procmsg_msginfo_free(&info);
if (messageview->deferred_destroy) {
debug_print("messageview got away!\n");
messageview_destroy(messageview);
if (!msginfo) return;
messageview->msginfo = NULL;
messageview_show(messageview, msginfo, messageview->all_headers);
- procmsg_msginfo_free(msginfo);
+ procmsg_msginfo_free(&msginfo);
main_window_set_menu_sensitive(messageview->mainwin);
summary_redisplay_msg(messageview->mainwin->summaryview);
}
messageview->msginfo = NULL;
messageview_show(messageview, msginfo,
messageview->all_headers);
- procmsg_msginfo_free(msginfo);
+ procmsg_msginfo_free(&msginfo);
/* update main window */
main_window_set_menu_sensitive(messageview->mainwin);
avatarr = avatars_avatarrender_new(full_msginfo);
hooks_invoke(AVATAR_IMAGE_RENDER_HOOKLIST, avatarr);
- procmsg_msginfo_free(full_msginfo);
+ procmsg_msginfo_free(&full_msginfo);
if (avatarr->image != NULL)
picture = gtk_image_get_pixbuf(GTK_IMAGE(avatarr->image));
MsgInfo *info = folder_item_get_msginfo(parent, to_number(name));
if (info != NULL) {
gboolean ok = mh_renumber_msg(info);
- procmsg_msginfo_free(info);
+ procmsg_msginfo_free(&info);
if (!ok) {
g_free(fullpath);
return NULL;
static gboolean msgcache_msginfo_free_func(gpointer num, gpointer msginfo, gpointer user_data)
{
- procmsg_msginfo_free((MsgInfo *)msginfo);
+ procmsg_msginfo_free((MsgInfo **)&msginfo);
return TRUE;
}
msginfo->folder->cache_dirty = TRUE;
- procmsg_msginfo_free(msginfo);
+ procmsg_msginfo_free(&msginfo);
cache->last_access = time(NULL);
if (oldmsginfo) {
g_hash_table_remove(cache->msgnum_table, &oldmsginfo->msgnum);
cache->memusage -= procmsg_msginfo_memusage(oldmsginfo);
- procmsg_msginfo_free(oldmsginfo);
+ procmsg_msginfo_free(&oldmsginfo);
}
newmsginfo = procmsg_msginfo_new_ref(msginfo);
#define READ_CACHE_DATA(data, fp, total_len) \
{ \
if ((tmp_len = msgcache_read_cache_data_str(fp, &data, conv)) < 0) { \
- procmsg_msginfo_free(msginfo); \
+ procmsg_msginfo_free(&msginfo); \
error = TRUE; \
goto bail_err; \
} \
if ((ni = fread(&idata, sizeof(idata), 1, fp)) != 1) { \
g_warning("read_int: Cache data corrupted, read %zd of %zd at " \
"offset %ld", ni, sizeof(idata), ftell(fp)); \
- procmsg_msginfo_free(msginfo); \
+ procmsg_msginfo_free(&msginfo); \
error = TRUE; \
goto bail_err; \
} else \
} \
if ((tmp_len = msgcache_get_cache_data_str(walk_data, &data, tmp_len, conv)) < 0) { \
g_print("error at rem_len:%d\n", rem_len);\
- procmsg_msginfo_free(msginfo); \
+ procmsg_msginfo_free(&msginfo); \
error = TRUE; \
goto bail_err; \
} \
err = 0;
bail:
g_free(filename);
- procmsg_msginfo_free(tinfo);
+ procmsg_msginfo_free(&tinfo);
return err;
}
finalmsg = procmsg_msginfo_new_from_mimeinfo(newmsg, info);
if (!finalmsg) {
- procmsg_msginfo_free(newmsg);
+ procmsg_msginfo_free(&newmsg);
return -1;
}
msgnum = folder_item_add_msg(item, finalmsg->plaintext_file,
&flags, TRUE);
finalmsg->msgnum = msgnum;
- procmsg_msginfo_free(newmsg);
- procmsg_msginfo_free(finalmsg);
+ procmsg_msginfo_free(&newmsg);
+ procmsg_msginfo_free(&finalmsg);
newmsg = folder_item_get_msginfo(item, msgnum);
if (newmsg && item) {
procmsg_msginfo_unset_flags(newmsg, ~0, ~0);
procmsg_msginfo_set_flags(newmsg, flags.perm_flags, flags.tmp_flags);
- procmsg_msginfo_free(newmsg);
+ procmsg_msginfo_free(&newmsg);
}
return msgnum;
partinfo = procmime_mimeinfo_next(partinfo);
if (!partinfo || !gtk_tree_model_get_iter_first(model, &iter)) {
gtk_widget_destroy(attremover->window);
- procmsg_msginfo_free(newmsg);
+ procmsg_msginfo_free(&newmsg);
return;
}
info = procmime_scan_message(newmsg);
if ( !(partinfo = find_first_text_part(info)) ) {
- procmsg_msginfo_free(newmsg);
+ procmsg_msginfo_free(&newmsg);
continue;
}
partinfo->node->next = NULL;
G_CALLBACK(block_cb), block_data);
summary_select_by_msgnum(summaryview, info->msgnum);
summary_display_msg_selected(summaryview, FALSE);
- procmsg_msginfo_free(info);
+ procmsg_msginfo_free(&info);
g_signal_handlers_unblock_by_func(G_OBJECT(summaryview->ctree),
G_CALLBACK(block_cb), block_data);
}
if (_item == folder->inbox)
vcal_remove_event(folder, msginfo);
- procmsg_msginfo_free(msginfo);
+ procmsg_msginfo_free(&msginfo);
return 0;
}
info = folder_item_get_msginfo_by_msgid(folder->inbox, id);
if (info != NULL) {
- procmsg_msginfo_free(info);
+ procmsg_msginfo_free(&info);
return TRUE;
}
return FALSE;
if (info != NULL) {
debug_print("removing event %s\n", id);
vcal_remove_event(folder, info);
- procmsg_msginfo_free(info);
+ procmsg_msginfo_free(&info);
folder_item_scan(folder->inbox);
return TRUE;
}
g_free(url);
}
- procmsg_msginfo_free(msginfo);
+ procmsg_msginfo_free(&msginfo);
}
statusbar_progress_all(0,0,0);
debug_print("%s %s in %s\n", info?"found":"didn't find", orig_msg_id, outbox->path);
if (info) {
procmsg_msginfo_set_flags(info, MSG_RETRCPT_GOT, 0);
- procmsg_msginfo_free(info);
+ procmsg_msginfo_free(&info);
}
}
}
for (cur = mlist; cur != NULL; cur = cur->next) {
msginfo = (MsgInfo *)cur->data;
- procmsg_msginfo_free(msginfo);
+ procmsg_msginfo_free(&msginfo);
}
g_slist_free(mlist);
}
for (cur = file_list; cur != NULL; cur = cur->next) {
fileinfo = (MsgFileInfo *)cur->data;
- procmsg_msginfo_free(fileinfo->msginfo);
+ procmsg_msginfo_free(&(fileinfo->msginfo));
g_free(fileinfo->file);
g_free(fileinfo->flags);
g_free(fileinfo);
for (cur = mlist ; cur != NULL ; cur = cur->next) {
MsgInfo * msginfo = (MsgInfo *) cur->data;
if (MSG_IS_LOCKED(msginfo->flags)) {
- procmsg_msginfo_free(msginfo);
+ procmsg_msginfo_free(&msginfo);
continue;
}
if (msginfo->total_size != 0 &&
msginfo->size != (off_t)msginfo->total_size)
partial_mark_for_delete(msginfo);
- procmsg_msginfo_free(msginfo);
+ procmsg_msginfo_free(&msginfo);
}
g_slist_free(mlist);
folder_item_remove_all_msg(trash);
/* FIXME: supposedly if only one message is locked, and queue
* is being flushed, the following free says something like
* "freeing msg ## in folder (nil)". */
- procmsg_msginfo_free(msginfo);
+ procmsg_msginfo_free(&msginfo);
}
g_slist_free(sorted_list);
tmp_msginfo = procmsg_msginfo_get_full_info(msginfo); /* refcnt++ */
if (msginfo != NULL) {
procmsg_msginfo_unset_flags(msginfo, ~0, 0);
- procmsg_msginfo_free(msginfo); /* refcnt-- */
+ procmsg_msginfo_free(&msginfo); /* refcnt-- */
/* tmp_msginfo == msginfo */
if (tmp_msginfo && msginfo->extradata &&
(msginfo->extradata->dispositionnotificationto ||
msginfo->extradata->returnreceiptto)) {
procmsg_msginfo_set_flags(msginfo, MSG_RETRCPT_SENT, 0);
}
- procmsg_msginfo_free(tmp_msginfo); /* refcnt-- */
+ procmsg_msginfo_free(&tmp_msginfo); /* refcnt-- */
}
return 0;
msginfo->extradata->resent_from = g_strdup
(full_msginfo->extradata->resent_from);
}
- procmsg_msginfo_free(full_msginfo);
+ procmsg_msginfo_free(&full_msginfo);
return procmsg_msginfo_new_ref(msginfo);
}
return full_msginfo;
}
-void procmsg_msginfo_free(MsgInfo *msginfo)
+#define FREENULL(n) { g_free(n); n = NULL; }
+void procmsg_msginfo_free(MsgInfo **msginfo_ptr)
{
+ MsgInfo *msginfo = *msginfo_ptr;
+
if (msginfo == NULL) return;
msginfo->refcnt--;
folder_item_update(msginfo->to_folder, F_ITEM_UPDATE_MSGCNT);
}
- g_free(msginfo->fromspace);
+ FREENULL(msginfo->fromspace);
- g_free(msginfo->fromname);
+ FREENULL(msginfo->fromname);
- g_free(msginfo->date);
- g_free(msginfo->from);
- g_free(msginfo->to);
- g_free(msginfo->cc);
- g_free(msginfo->newsgroups);
- g_free(msginfo->subject);
- g_free(msginfo->msgid);
- g_free(msginfo->inreplyto);
- g_free(msginfo->xref);
+ FREENULL(msginfo->date);
+ FREENULL(msginfo->from);
+ FREENULL(msginfo->to);
+ FREENULL(msginfo->cc);
+ FREENULL(msginfo->newsgroups);
+ FREENULL(msginfo->subject);
+ FREENULL(msginfo->msgid);
+ FREENULL(msginfo->inreplyto);
+ FREENULL(msginfo->xref);
if (msginfo->extradata) {
if (msginfo->extradata->avatars) {
NULL);
g_slist_free(msginfo->extradata->avatars);
}
- g_free(msginfo->extradata->returnreceiptto);
- g_free(msginfo->extradata->dispositionnotificationto);
- g_free(msginfo->extradata->list_post);
- g_free(msginfo->extradata->list_subscribe);
- g_free(msginfo->extradata->list_unsubscribe);
- g_free(msginfo->extradata->list_help);
- g_free(msginfo->extradata->list_archive);
- g_free(msginfo->extradata->list_owner);
- g_free(msginfo->extradata->partial_recv);
- g_free(msginfo->extradata->account_server);
- g_free(msginfo->extradata->account_login);
- g_free(msginfo->extradata->resent_from);
- g_free(msginfo->extradata);
+ FREENULL(msginfo->extradata->returnreceiptto);
+ FREENULL(msginfo->extradata->dispositionnotificationto);
+ FREENULL(msginfo->extradata->list_post);
+ FREENULL(msginfo->extradata->list_subscribe);
+ FREENULL(msginfo->extradata->list_unsubscribe);
+ FREENULL(msginfo->extradata->list_help);
+ FREENULL(msginfo->extradata->list_archive);
+ FREENULL(msginfo->extradata->list_owner);
+ FREENULL(msginfo->extradata->partial_recv);
+ FREENULL(msginfo->extradata->account_server);
+ FREENULL(msginfo->extradata->account_login);
+ FREENULL(msginfo->extradata->resent_from);
+ FREENULL(msginfo->extradata);
}
slist_free_strings_full(msginfo->references);
g_slist_free(msginfo->tags);
- g_free(msginfo->plaintext_file);
+ FREENULL(msginfo->plaintext_file);
- g_free(msginfo);
+ FREENULL(msginfo);
}
+#undef FREENULL
guint procmsg_msginfo_memusage(MsgInfo *msginfo)
{
debug_print("copied queued mail %d to sent folder\n", msgnum);
saved = TRUE;
}
- procmsg_msginfo_free(queued_mail);
+ procmsg_msginfo_free(&queued_mail);
}
if (!saved) {
debug_print("resaving queued mail to sent folder\n");
if ((msginfo != NULL) &&
(msginfo->msgid != NULL) &&
(strcmp(msginfo->msgid, tokens[2]) != 0)) {
- procmsg_msginfo_free(msginfo);
+ procmsg_msginfo_free(&msginfo);
msginfo = NULL;
}
} else {
procmsg_msginfo_set_flags(msginfo, MSG_FORWARDED, 0);
}
- procmsg_msginfo_free(msginfo);
+ procmsg_msginfo_free(&msginfo);
}
}
g_strfreev(tokens);
tmp = folder_item_get_msginfo_by_msgid(info->folder,
info->inreplyto);
if (tmp && (tmp->flags.perm_flags & perm_flags)) {
- procmsg_msginfo_free(tmp);
+ procmsg_msginfo_free(&tmp);
return TRUE;
} else if (tmp != NULL) {
gboolean result;
result = procmsg_msg_has_flagged_parent_real(
tmp, perm_flags, parentmsgs);
}
- procmsg_msginfo_free(tmp);
+ procmsg_msginfo_free(&tmp);
return result;
} else {
return FALSE;
for (cur = all; cur != NULL; cur = g_slist_next(cur)) {
/* this will not free the used pointers
created with procmsg_msginfo_new_ref */
- procmsg_msginfo_free((MsgInfo *)cur->data);
+ procmsg_msginfo_free((MsgInfo **)&(cur->data));
}
}
g_slist_free(all);
info->folder->unreadmarked_msgs--;
folder_item_update(info->folder, F_ITEM_UPDATE_MSGCNT);
}
- procmsg_msginfo_free(tmp);
+ procmsg_msginfo_free(&tmp);
}
g_slist_free(children);
}
MsgInfo *procmsg_msginfo_get_full_info_from_file
(MsgInfo *msginfo,
const gchar *file);
-void procmsg_msginfo_free (MsgInfo *msginfo);
+void procmsg_msginfo_free (MsgInfo **msginfo);
guint procmsg_msginfo_memusage (MsgInfo *msginfo);
gint procmsg_send_message_queue_with_lock(const gchar *file,
strncpy2(spec_from, ac_prefs->address, BUFFSIZE-1);
}
if (tmp_msginfo) {
- procmsg_msginfo_free(tmp_msginfo);
+ procmsg_msginfo_free(&tmp_msginfo);
}
if (!ac_prefs->session) {
if (!msginfo->hidden) {
if (MSG_IS_DELETED(msginfo->flags) && summaryview->folder_item->hide_del_msgs) {
- procmsg_msginfo_free(msginfo);
+ procmsg_msginfo_free(&msginfo);
continue;
}
if (summaryview->folder_item->hide_read_msgs) {
msginfo->msgnum == displayed_msgnum))
not_killed = g_slist_prepend(not_killed, msginfo);
else
- procmsg_msginfo_free(msginfo);
+ procmsg_msginfo_free(&msginfo);
} else {
not_killed = g_slist_prepend(not_killed, msginfo);
}
} else
- procmsg_msginfo_free(msginfo);
+ procmsg_msginfo_free(&msginfo);
}
hidden_removed = TRUE;
g_slist_free(mlist);
if (!msginfo->hidden)
not_killed = g_slist_prepend(not_killed, msginfo);
else
- procmsg_msginfo_free(msginfo);
+ procmsg_msginfo_free(&msginfo);
}
g_slist_free(mlist);
mlist = not_killed;
MsgInfo *msginfo = gtk_cmctree_node_get_row_data(ctree, node);
if (msginfo)
- procmsg_msginfo_free(msginfo);
+ procmsg_msginfo_free(&msginfo);
}
static void summary_set_marks_func(GtkCMCTree *ctree, GtkCMCTreeNode *node,
if (mdata->msginfo == summary_get_selected_msg(mdata->summaryview))
msginfo_mark_as_read(mdata->summaryview, mdata->msginfo,
mdata->summaryview->selected);
- procmsg_msginfo_free(mdata->msginfo);
+ procmsg_msginfo_free(&(mdata->msginfo));
mdata->summaryview->mark_as_read_timeout_tag = 0;
summary_unlock(mdata->summaryview);
avatarr = avatars_avatarrender_new(full_msginfo);
hooks_invoke(AVATAR_IMAGE_RENDER_HOOKLIST, avatarr);
- procmsg_msginfo_free(full_msginfo);
+ procmsg_msginfo_free(&full_msginfo);
if (avatarr->image)
picture = gtk_image_get_pixbuf(GTK_IMAGE(avatarr->image));
if (!summaryview->folder_item->folder->account || summaryview->folder_item->folder->account->imap_use_trash) {
for (cur = summaryview->mlist; cur != NULL && cur->data != NULL; cur = cur->next)
- procmsg_msginfo_free((MsgInfo *)cur->data);
+ procmsg_msginfo_free((MsgInfo **)&(cur->data));
}
if (summaryview->folder_item->folder->account && !summaryview->folder_item->folder->account->imap_use_trash) {
gtk_cmctree_pre_recursive(ctree, NULL, summary_set_deleted_func,
summary_update_msg, (gpointer) summaryview);
if (!summaryview->folder_item->folder->account || summaryview->folder_item->folder->account->imap_use_trash) {
for (cur = summaryview->mlist; cur != NULL && cur->data != NULL; cur = cur->next)
- procmsg_msginfo_free((MsgInfo *)cur->data);
+ procmsg_msginfo_free((MsgInfo **)&(cur->data));
}
g_slist_free(summaryview->mlist);
summaryview->mlist = NULL;
hooks_register_hook(MSGINFO_UPDATE_HOOKLIST,
summary_update_msg, (gpointer) summaryview);
for (cur = summaryview->mlist; cur != NULL && cur->data != NULL; cur = cur->next)
- procmsg_msginfo_free((MsgInfo *)cur->data);
+ procmsg_msginfo_free((MsgInfo **)&(cur->data));
g_slist_free(summaryview->mlist);
summaryview->mlist = NULL;
filtering_move_and_copy_msgs(mlist);
for (cur_list = mlist; cur_list; cur_list = cur_list->next) {
- procmsg_msginfo_free((MsgInfo *)cur_list->data);
+ procmsg_msginfo_free((MsgInfo **)&(cur_list->data));
}
g_slist_free(mlist);