+2006-04-06 [mones] 2.1.0cvs7
+
+ * src/addr_compl.c
+ * src/addrindex.c
+ * src/addritem.c
+ * src/codeconv.c
+ * src/compose.c
+ * src/filtering.c
+ * src/folder.c
+ * src/folder_item_prefs.c
+ * src/folderview.c
+ * src/localfolder.c
+ * src/matcher.c
+ * src/mimeview.c
+ * src/prefs_msg_colors.c
+ * src/prefs_spelling.c
+ * src/prefs_themes.c
+ * src/procmime.c
+ * src/procmsg.c
+ * src/stock_pixmap.c
+ * src/summaryview.c
+ * src/textview.c
+ * src/toolbar.c
+ * src/common/mgutils.c
+ * src/common/prefs.c
+ * src/common/ssl_certificate.c
+ * src/gtk/colorlabel.c
+ * src/gtk/quicksearch.c
+ * src/plugins/pgpmime/pgpmime.c
+ * src/plugins/spamassassin/spamassassin.c
+ Removed redundant NULL checks for g_free() calls.
+ Patch by Pawel Pekala.
+
2006-04-06 [mones] 2.1.0cvs6
* src/prefs_actions.c
( cvs diff -u -r 1.1.2.28 -r 1.1.2.29 src/wizard.c; cvs diff -u -r 1.10.2.17 -r 1.10.2.18 src/prefs_gtk.c; ) > 2.1.0cvs4.patchset
( cvs diff -u -r 1.60.2.57 -r 1.60.2.58 src/addressbook.c; ) > 2.1.0cvs5.patchset
( cvs diff -u -r 1.60.2.32 -r 1.60.2.33 src/prefs_actions.c; cvs diff -u -r 1.59.2.32 -r 1.59.2.33 src/prefs_filtering.c; cvs diff -u -r 1.1.4.25 -r 1.1.4.26 src/prefs_filtering_action.c; cvs diff -u -r 1.43.2.36 -r 1.43.2.37 src/prefs_matcher.c; cvs diff -u -r 1.12.2.23 -r 1.12.2.24 src/prefs_template.c; cvs diff -u -r 1.5.2.24 -r 1.5.2.25 src/gtk/gtkutils.c; cvs diff -u -r 1.4.2.19 -r 1.4.2.20 src/gtk/gtkutils.h; ) > 2.1.0cvs6.patchset
+( cvs diff -u -r 1.27.2.17 -r 1.27.2.18 src/addr_compl.c; cvs diff -u -r 1.28.2.15 -r 1.28.2.16 src/addrindex.c; cvs diff -u -r 1.13.2.5 -r 1.13.2.6 src/addritem.c; cvs diff -u -r 1.65.2.46 -r 1.65.2.47 src/codeconv.c; cvs diff -u -r 1.382.2.258 -r 1.382.2.259 src/compose.c; cvs diff -u -r 1.60.2.14 -r 1.60.2.15 src/filtering.c; cvs diff -u -r 1.213.2.87 -r 1.213.2.88 src/folder.c; cvs diff -u -r 1.2.2.12 -r 1.2.2.13 src/folder_item_prefs.c; cvs diff -u -r 1.207.2.91 -r 1.207.2.92 src/folderview.c; cvs diff -u -r 1.3.4.3 -r 1.3.4.4 src/localfolder.c; cvs diff -u -r 1.75.2.19 -r 1.75.2.20 src/matcher.c; cvs diff -u -r 1.83.2.66 -r 1.83.2.67 src/mimeview.c; cvs diff -u -r 1.1.2.19 -r 1.1.2.20 src/prefs_msg_colors.c; cvs diff -u -r 1.5.2.21 -r 1.5.2.22 src/prefs_spelling.c; cvs diff -u -r 1.3.2.40 -r 1.3.2.41 src/prefs_themes.c; cvs diff -u -r 1.49.2.75 -r 1.49.2.76 src/procmime.c; cvs diff -u -r 1.150.2.59 -r 1.150.2.60 src/procmsg.c; cvs diff -u -r 1.25.2.22 -r 1.25.2.23 src/stock_pixmap.c; cvs diff -u -r 1.395.2.190 -r 1.395.2.191 src/summaryview.c; cvs diff -u -r 1.96.2.106 -r 1.96.2.107 src/textview.c; cvs diff -u -r 1.43.2.42 -r 1.43.2.43 src/toolbar.c; cvs diff -u -r 1.1.4.3 -r 1.1.4.4 src/common/mgutils.c; cvs diff -u -r 1.5.2.5 -r 1.5.2.6 src/common/prefs.c; cvs diff -u -r 1.4.2.6 -r 1.4.2.7 src/common/ssl_certificate.c; cvs diff -u -r 1.2.2.12 -r 1.2.2.13 src/gtk/colorlabel.c; cvs diff -u -r 1.1.2.37 -r 1.1.2.38 src/gtk/quicksearch.c; cvs diff -u -r 1.1.2.32 -r 1.1.2.33 src/plugins/pgpmime/pgpmime.c; cvs diff -u -r 1.18.2.32 -r 1.18.2.33 src/plugins/spamassassin/spamassassin.c; ) > 2.1.0cvs7.patchset
MICRO_VERSION=0
INTERFACE_AGE=0
BINARY_AGE=0
-EXTRA_VERSION=6
+EXTRA_VERSION=7
EXTRA_RELEASE=
EXTRA_GTK2_VERSION=
static void clear_completion_cache(void)
{
if (is_completion_pending()) {
- if (g_completion_prefix)
- g_free(g_completion_prefix);
+ g_free(g_completion_prefix);
if (g_completion_addresses) {
g_slist_free(g_completion_addresses);
/* printf( "search for :::%s:::\n", searchTerm ); */
/* Clear any existing search */
- if( _compWindow_->searchTerm ) {
- g_free( _compWindow_->searchTerm );
- }
+ g_free( _compWindow_->searchTerm );
_compWindow_->searchTerm = g_strdup( searchTerm );
/* Perform search on local completion index */
gint ivalue = atoi( value );
if( strcmp( name, ATTAG_LDAP_NAME ) == 0 ) {
- if( serverName ) g_free( serverName );
+ g_free( serverName );
serverName = g_strdup( value );
}
else if( strcmp( name, ATTAG_LDAP_HOST ) == 0 ) {
ldapctl_set_bind_password( ctl, value );
}
else if( strcmp( name, ATTAG_LDAP_CRITERIA ) == 0 ) {
- if( criteria ) g_free( criteria );
+ g_free( criteria );
criteria = g_strdup( value );
}
else if( strcmp( name, ATTAG_LDAP_MAX_ENTRY ) == 0 ) {
}
}
- if( person->firstName ) {
- g_free( person->firstName );
- }
+ g_free( person->firstName );
person->firstName = fName;
if( person->firstName )
g_strstrip( person->firstName );
- if( person->lastName ) {
- g_free( person->lastName );
- }
+ g_free( person->lastName );
person->lastName = lName;
if( person->lastName )
g_strstrip( person->lastName );
g_free(tmpstr);
return;
} else {
- if (tmpstr)
- g_free(tmpstr);
+ g_free(tmpstr);
conv_utf8todisp(outbuf, outlen, inbuf);
}
}
* Replace existing string with new string.
*/
gchar *mgu_replace_string( gchar *str, const gchar *value ) {
- if( str ) g_free( str );
+ g_free( str );
if( value ) {
str = g_strdup( value );
g_strstrip( str );
*/
#define PREFS_FILE_FREE() \
{ \
- if (path) g_free(path); \
- if (tmppath) g_free(tmppath); \
- if (bakpath) g_free(bakpath); \
- if (pfile) g_free(pfile); \
+ g_free(path); \
+ g_free(tmppath); \
+ g_free(bakpath); \
+ g_free(pfile); \
}
gint prefs_file_close(PrefFile *pfile)
{
fingerprint,
(sig_status==NULL ? "correct":sig_status));
- if (issuer_commonname)
- g_free(issuer_commonname);
- if (issuer_location)
- g_free(issuer_location);
- if (issuer_organization)
- g_free(issuer_organization);
- if (subject_commonname)
- g_free(subject_commonname);
- if (subject_location)
- g_free(subject_location);
- if (subject_organization)
- g_free(subject_organization);
- if (fingerprint)
- g_free(fingerprint);
- if (sig_status)
- g_free(sig_status);
+ g_free(issuer_commonname);
+ g_free(issuer_location);
+ g_free(issuer_organization);
+ g_free(subject_commonname);
+ g_free(subject_location);
+ g_free(subject_organization);
+ g_free(fingerprint);
+ g_free(sig_status);
return ret;
}
if (cert->x509_cert)
X509_free(cert->x509_cert);
- if (cert->host)
- g_free(cert->host);
+ g_free(cert->host);
g_free(cert);
cert = NULL;
}
mimempart->subtype = g_strdup("mixed");
do {
- if (boundary)
- g_free(boundary);
+ g_free(boundary);
boundary = generate_mime_boundary(NULL);
} while (strstr(buf, boundary) != NULL);
g_free(compose->msgid);
g_free(compose->boundary);
- if (compose->redirect_filename)
- g_free(compose->redirect_filename);
+ g_free(compose->redirect_filename);
if (compose->undostruct)
undo_destroy(compose->undostruct);
void filteringaction_free(FilteringAction * action)
{
g_return_if_fail(action);
- if (action->destination)
- g_free(action->destination);
+ g_free(action->destination);
g_free(action);
}
if (!attr || !attr->name || !attr->value) continue;
if (!strcmp(attr->name, "name")) {
- if (folder->name != NULL)
- g_free(folder->name);
+ g_free(folder->name);
folder->name = g_strdup(attr->value);
if (rootitem != NULL) {
- if (rootitem->name != NULL)
- g_free(rootitem->name);
+ g_free(rootitem->name);
rootitem->name = g_strdup(attr->value);
}
} else if (!strcmp(attr->name, "account_id")) {
else if (!g_ascii_strcasecmp(attr->value, "trash"))
item->stype = F_TRASH;
} else if (!strcmp(attr->name, "name")) {
- if (item->name != NULL)
- g_free(item->name);
+ g_free(item->name);
item->name = g_strdup(attr->value);
} else if (!strcmp(attr->name, "path")) {
- if (item->path != NULL)
- g_free(item->path);
+ g_free(item->path);
item->path = g_strdup(attr->value);
} else if (!strcmp(attr->name, "mtime"))
item->mtime = strtoul(attr->value, NULL, 10);
static gboolean persist_prefs_free(gpointer key, gpointer val, gpointer data)
{
- if (key)
- g_free(key);
- if (val)
- g_free(val);
+ g_free(key);
+ g_free(val);
return TRUE;
}
void folder_item_prefs_free(FolderItemPrefs * prefs)
{
- if (prefs->default_to)
- g_free(prefs->default_to);
- if (prefs->default_reply_to)
- g_free(prefs->default_reply_to);
+ g_free(prefs->default_to);
+ g_free(prefs->default_reply_to);
g_free(prefs);
}
void folderview_reflect_prefs_pixmap_theme(FolderView *folderview)
{
/* force reinit */
- if (last_font)
- g_free(last_font);
+ g_free(last_font);
last_font = NULL;
}
if (last_font && !strcmp(last_font, NORMAL_FONT))
update_font = FALSE;
- if (last_font)
- g_free(last_font);
-
+ g_free(last_font);
last_font = g_strdup(NORMAL_FONT);
if (update_font) {
for (c = 0; c < COLORLABELS; c++) {
INTCOLOR_TO_GDKCOLOR(prefs_common.custom_colorlabel[c].color,
label_colors[i][c].color);
- if (label_colors[i][c].label != NULL) {
- g_free(label_colors[i][c].label);
- }
+ g_free(label_colors[i][c].label);
label_colors[i][c].label =
g_strdup(prefs_common.custom_colorlabel[c].label);
}
return;
}
} else {
- if (quicksearch->search_string != NULL)
- g_free(quicksearch->search_string);
+ g_free(quicksearch->search_string);
quicksearch->search_string = g_strdup(search_string);
}
if (!attr || !attr->name || !attr->value) continue;
if (!strcmp(attr->name, "path")) {
- if (folder->rootpath != NULL)
- g_free(folder->rootpath);
+ g_free(folder->rootpath);
folder->rootpath = g_strdup(attr->value);
}
}
*/
void matcherprop_free(MatcherProp *prop)
{
- if (prop->expr)
- g_free(prop->expr);
- if (prop->header)
- g_free(prop->header);
+ g_free(prop->expr);
+ g_free(prop->header);
if (prop->preg != NULL) {
regfree(prop->preg);
g_free(prop->preg);
dirname = filesel_select_file_save_folder(_("Select destination folder"), startdir);
if (!dirname) {
- if (startdir) g_free(startdir);
+ g_free(startdir);
return;
}
if (!is_dir_exist (dirname)) {
alertpanel_error(_("'%s' is not a directory."),
dirname);
- if (startdir) g_free(startdir);
+ g_free(startdir);
return;
}
partinfo = procmime_mimeinfo_next(partinfo);
}
- if (prefs_common.attach_save_dir)
- g_free(prefs_common.attach_save_dir);
-
+ g_free(prefs_common.attach_save_dir);
+ g_free(startdir);
prefs_common.attach_save_dir = g_strdup(dirname);
-
- if (startdir) g_free(startdir);
}
/**
filedir = g_path_get_dirname(filename);
if (filedir && strcmp(filedir, ".")) {
- if (prefs_common.attach_save_dir)
- g_free(prefs_common.attach_save_dir);
+ g_free(prefs_common.attach_save_dir);
prefs_common.attach_save_dir = g_strdup(filedir);
}
sigmultipart->subtype = g_strdup("signed");
do {
- if (boundary)
- g_free(boundary);
+ g_free(boundary);
boundary = generate_mime_boundary("Sig");
} while (strstr(test_msg, boundary) != NULL);
execute_command_line(tmpcmd, FALSE);
g_free(tmpcmd);
}
- if (tmpfile != NULL) {
- g_free(tmpfile);
- }
- }
- if (spamc_wrapper != NULL) {
- g_free(spamc_wrapper);
+ g_free(tmpfile);
}
+ g_free(spamc_wrapper);
return 0;
} else {
cmd = g_strdup_printf("sa-learn -u %s %s %s",
g_free(cmd);
cmd = tmpcmd;
}
- if (tmpfile != NULL) {
- g_free(tmpfile);
- }
+ g_free(tmpfile);
}
}
}
/* only run sync calls to sa-learn/spamc to prevent system lockdown */
execute_command_line(cmd, FALSE);
g_free(cmd);
- if (spamc_wrapper != NULL) {
- g_free(spamc_wrapper);
- }
+ g_free(spamc_wrapper);
+
return 0;
}
/* custom colors */
for (c = 0; c < COLORLABELS; c++) {
- if (prefs_common.custom_colorlabel[c].label)
- g_free(prefs_common.custom_colorlabel[c].label);
+ g_free(prefs_common.custom_colorlabel[c].label);
prefs_common.custom_colorlabel[c].label =
gtk_editable_get_chars(GTK_EDITABLE(page->custom_colorlabel_entry[c]), 0, -1);
}
prefs_common.use_alternate =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(spelling->use_alternate_checkbtn));
- if (prefs_common.aspell_path)
- g_free(prefs_common.aspell_path);
+ g_free(prefs_common.aspell_path);
prefs_common.aspell_path =
gtk_editable_get_chars(GTK_EDITABLE(spelling->aspell_path_entry), 0, -1);
- if (prefs_common.dictionary != NULL)
- g_free(prefs_common.dictionary);
+ g_free(prefs_common.dictionary);
prefs_common.dictionary =
gtkaspell_get_dictionary_menu_active_item(
gtk_option_menu_get_menu(
theme_str = tdata->displayed;
- if (prefs_common.pixmap_theme_path != NULL)
g_free(prefs_common.pixmap_theme_path);
prefs_common.pixmap_theme_path = g_strdup(theme_str);
else
alertpanel_error(_("File %s failed\nwhile installing theme."), cinfo->status);
end_inst:
- if (cinfo->dest != NULL) g_free(cinfo->dest);
+ g_free(cinfo->dest);
g_free(filename);
g_free(source);
g_free(themeinfo);
stat(tmpfilename, &statbuf);
if (mimeinfo->tmp && (mimeinfo->data.filename != NULL))
g_unlink(mimeinfo->data.filename);
- if (mimeinfo->data.filename != NULL)
- g_free(mimeinfo->data.filename);
+ g_free(mimeinfo->data.filename);
mimeinfo->data.filename = tmpfilename;
mimeinfo->tmp = TRUE;
mimeinfo->offset = 0;
static gchar *spam_folder_item = NULL;
void procmsg_spam_set_folder (const char *item_identifier)
{
- if (spam_folder_item)
- g_free(spam_folder_item);
+ g_free(spam_folder_item);
if (item_identifier)
spam_folder_item = g_strdup(item_identifier);
else
if (err) g_error_free(err);
}
if (pix) {
- if (pix_d->icon_path != NULL) g_free(pix_d->icon_path);
+ g_free(pix_d->icon_path);
pix_d->icon_path = g_strdup(prefs_common.pixmap_theme_path);
}
g_free(icon_file_name);
if (!pix_d->pixbuf) {
pix_d->pixbuf = gdk_pixbuf_new_from_xpm_data((const gchar **) pix_d->data);
if (pix_d->pixbuf) {
- if (pix_d->icon_path != NULL) g_free(pix_d->icon_path);
+ g_free(pix_d->icon_path);
pix_d->icon_path = g_strdup(DEFAULT_PIXMAP_THEME);
}
}
if (is_file_exist(icon_file_name))
PIXMAP_CREATE_FROM_FILE(window, pix, pix_d->mask, icon_file_name);
if (pix) {
- if (pix_d->icon_path != NULL) g_free(pix_d->icon_path);
+ g_free(pix_d->icon_path);
pix_d->icon_path = g_strdup(prefs_common.pixmap_theme_path);
}
g_free(icon_file_name);
if (!pix_d->pixmap) {
PIXMAP_CREATE(window, pix_d->pixmap, pix_d->mask, pix_d->data);
if (pix_d->pixmap) {
- if (pix_d->icon_path != NULL) g_free(pix_d->icon_path);
+ g_free(pix_d->icon_path);
pix_d->icon_path = g_strdup(DEFAULT_PIXMAP_THEME);
}
}
GList *ptr;
for (ptr = g_list_first(list); ptr != NULL; ptr = g_list_next(ptr))
- if (ptr->data)
- g_free(ptr->data);
+ g_free(ptr->data);
g_list_free(list);
}
if (last_font && !strcmp(last_font, NORMAL_FONT))
update_font = FALSE;
- if (last_font)
- g_free(last_font);
+ g_free(last_font);
last_font = g_strdup(NORMAL_FONT);
filedir = g_path_get_dirname(filename);
if (filedir && strcmp(filedir, ".")) {
- if (prefs_common.attach_save_dir)
- g_free(prefs_common.attach_save_dir);
+ g_free(prefs_common.attach_save_dir);
prefs_common.attach_save_dir = g_strdup(filedir);
}
toolbar_config[source].item_list =
g_slist_remove(toolbar_config[source].item_list, item);
- if (item->file)
- g_free(item->file);
- if (item->text)
- g_free(item->text);
+ g_free(item->file);
+ g_free(item->text);
g_free(item);
}
g_slist_free(toolbar_config[source].item_list);
while (entry_list != NULL) {
Entry *e = (Entry*) entry_list->data;
- if (e)
- g_free(e);
+ g_free(e);
entry_list = g_slist_remove(entry_list, e);
}