2006-04-06 [mones] 2.1.0cvs7
authorRicardo Mones <mones@claws-mail.org>
Thu, 6 Apr 2006 10:58:17 +0000 (10:58 +0000)
committerRicardo Mones <mones@claws-mail.org>
Thu, 6 Apr 2006 10:58:17 +0000 (10:58 +0000)
* 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.

31 files changed:
ChangeLog
PATCHSETS
configure.ac
src/addr_compl.c
src/addrindex.c
src/addritem.c
src/codeconv.c
src/common/mgutils.c
src/common/prefs.c
src/common/ssl_certificate.c
src/compose.c
src/filtering.c
src/folder.c
src/folder_item_prefs.c
src/folderview.c
src/gtk/colorlabel.c
src/gtk/quicksearch.c
src/localfolder.c
src/matcher.c
src/mimeview.c
src/plugins/pgpmime/pgpmime.c
src/plugins/spamassassin/spamassassin.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

index 931383e..ac69b4e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,36 @@
+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
index 45f1b4a..3f8ad83 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( 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
index 5f0cd06..582bd28 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=1
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=6
+EXTRA_VERSION=7
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index cf90e70..75bffcb 100644 (file)
@@ -282,8 +282,7 @@ static gboolean is_completion_pending(void)
 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);
@@ -1102,9 +1101,7 @@ static gboolean address_completion_complete_address_in_entry(GtkEntry *entry,
        /* 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 */
index c594ade..96f8e8b 100644 (file)
@@ -1333,7 +1333,7 @@ static AddressDataSource *addrindex_parse_ldap( XMLFile *file ) {
                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 ) {
@@ -1352,7 +1352,7 @@ static AddressDataSource *addrindex_parse_ldap( XMLFile *file ) {
                        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 ) {
index 3cd8aa5..b642339 100644 (file)
@@ -1406,16 +1406,12 @@ void addritem_parse_first_last( ItemPerson *person ) {
                }
        }
 
-       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 );
index 4bc05aa..3bdb47d 100644 (file)
@@ -636,8 +636,7 @@ void conv_localetodisp(gchar *outbuf, gint outlen, const gchar *inbuf)
                g_free(tmpstr);
                return;
        } else {
-               if (tmpstr)
-                       g_free(tmpstr);
+               g_free(tmpstr);
                conv_utf8todisp(outbuf, outlen, inbuf);
        }
 }
index e809b2d..3022683 100644 (file)
@@ -115,7 +115,7 @@ gchar *mgu_list_coalesce( GSList *list ) {
 * 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 );
index fd73e38..8110daf 100644 (file)
@@ -109,10 +109,10 @@ PrefFile *prefs_write_open(const gchar *path)
  */
 #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)
 {
index f88716e..ad5554a 100644 (file)
@@ -194,22 +194,14 @@ char* ssl_certificate_to_string(SSLCertificate *cert)
                                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;
 }
        
@@ -220,8 +212,7 @@ void ssl_certificate_destroy(SSLCertificate *cert)
 
        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;
 }
index 9be088a..1664ea4 100644 (file)
@@ -4309,8 +4309,7 @@ static gint compose_write_to_file(Compose *compose, FILE *fp, gint action)
                mimempart->subtype = g_strdup("mixed");
 
                do {
-                       if (boundary)
-                               g_free(boundary);
+                       g_free(boundary);
                        boundary = generate_mime_boundary(NULL);
                } while (strstr(buf, boundary) != NULL);
 
@@ -6363,8 +6362,7 @@ static void compose_destroy(Compose *compose)
        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);
 
index 164cafc..6437f86 100644 (file)
@@ -78,8 +78,7 @@ FilteringAction * filteringaction_new(int type, int account_id,
 void filteringaction_free(FilteringAction * action)
 {
        g_return_if_fail(action);
-       if (action->destination)
-               g_free(action->destination);
+       g_free(action->destination);
        g_free(action);
 }
 
index 766d47b..c54e4c8 100644 (file)
@@ -225,12 +225,10 @@ void folder_set_xml(Folder *folder, XMLTag *tag)
 
                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")) {
@@ -461,12 +459,10 @@ void folder_item_set_xml(Folder *folder, FolderItem *item, XMLTag *tag)
                        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);
@@ -3541,10 +3537,8 @@ static void folder_get_persist_prefs_recursive(GNode *node, GHashTable *pptable)
 
 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;    
 }
 
index b9d97be..7caaa7e 100644 (file)
@@ -205,10 +205,8 @@ FolderItemPrefs * folder_item_prefs_new(void)
 
 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);
 }
 
index d000a00..1f362f1 100644 (file)
@@ -2273,8 +2273,7 @@ static gchar *last_font = NULL;
 void folderview_reflect_prefs_pixmap_theme(FolderView *folderview)
 {
        /* force reinit */
-       if (last_font) 
-               g_free(last_font);
+       g_free(last_font);
        last_font = NULL;
        
 }
@@ -2291,9 +2290,7 @@ void folderview_reflect_prefs(void)
        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) {              
index 41f15f9..d6ae64f 100644 (file)
@@ -125,9 +125,7 @@ void colorlabel_update_colortable_from_prefs(void)
                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);
                }
index ca59d15..95866af 100644 (file)
@@ -104,8 +104,7 @@ static void prepare_matcher(QuickSearch *quicksearch)
                        return;
                }
        } else {
-               if (quicksearch->search_string != NULL)
-                       g_free(quicksearch->search_string);
+               g_free(quicksearch->search_string);
                quicksearch->search_string = g_strdup(search_string);
        }
 
index f13a730..1b39e97 100644 (file)
@@ -49,8 +49,7 @@ void folder_local_set_xml(Folder *_folder, XMLTag *tag)
 
                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);
                }
        }
index 8d86aea..85dd553 100644 (file)
@@ -237,10 +237,8 @@ MatcherProp *matcherprop_new(gint criteria, const gchar *header,
  */
 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);
index 9698157..e9a194b 100644 (file)
@@ -1409,14 +1409,14 @@ static void mimeview_save_all(MimeView *mimeview)
 
        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;
        }
 
@@ -1445,12 +1445,9 @@ static void mimeview_save_all(MimeView *mimeview)
                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);
 }
 
 /**
@@ -1509,8 +1506,7 @@ static void mimeview_save_as(MimeView *mimeview)
 
        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);
        }
 
index d5bb140..3898427 100644 (file)
@@ -414,8 +414,7 @@ gboolean pgpmime_sign(MimeInfo *mimeinfo, PrefsAccount *account)
        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);
        
index 94cce18..9ac5dcf 100644 (file)
@@ -346,13 +346,9 @@ int spamassassin_learn(MsgInfo *msginfo, GSList *msglist, gboolean spam)
                                        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",
@@ -372,9 +368,7 @@ int spamassassin_learn(MsgInfo *msginfo, GSList *msglist, gboolean spam)
                                        g_free(cmd);
                                        cmd = tmpcmd;
                                }
-                               if (tmpfile != NULL) {
-                                       g_free(tmpfile);
-                               }
+                               g_free(tmpfile);
                        }
                }
        }
@@ -385,9 +379,8 @@ int spamassassin_learn(MsgInfo *msginfo, GSList *msglist, gboolean spam)
        /* 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;
 }
 
index 206cdaf..1ea7d25 100644 (file)
@@ -540,8 +540,7 @@ void prefs_msg_colors_save(PrefsPage *_page)
 
        /* 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);
        }
index 40a28b9..8a3fbef 100644 (file)
@@ -368,13 +368,11 @@ void prefs_spelling_save(PrefsPage *_page)
        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(
index cb8fd6f..292e45c 100644 (file)
@@ -422,7 +422,6 @@ static void prefs_themes_btn_use_clicked_cb(GtkWidget *widget, gpointer data)
 
        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);
@@ -571,7 +570,7 @@ static void prefs_themes_btn_install_clicked_cb(GtkWidget *widget, gpointer data
        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);
index 7260289..b1d58b8 100644 (file)
@@ -346,8 +346,7 @@ gboolean procmime_decode_content(MimeInfo *mimeinfo)
        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;
index 72ef6c8..23d7e26 100644 (file)
@@ -2078,8 +2078,7 @@ int procmsg_spam_learner_learn (MsgInfo *info, GSList *list, gboolean spam)
 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
index f6bbe60..8a776f2 100644 (file)
@@ -350,7 +350,7 @@ gint stock_pixbuf_gdk(GtkWidget *window, StockPixmap icon, GdkPixbuf **pixbuf)
                                        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);
@@ -366,7 +366,7 @@ gint stock_pixbuf_gdk(GtkWidget *window, StockPixmap icon, GdkPixbuf **pixbuf)
        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);      
                }
        }
@@ -410,7 +410,7 @@ gint stock_pixmap_gdk(GtkWidget *window, StockPixmap icon,
                                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);
@@ -426,7 +426,7 @@ gint stock_pixmap_gdk(GtkWidget *window, StockPixmap icon,
        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);      
                }
        }
@@ -507,8 +507,7 @@ void stock_pixmap_themes_list_free(GList *list)
        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);              
 }
 
index 2683829..e654ddd 100644 (file)
@@ -2170,8 +2170,7 @@ void summary_reflect_prefs(void)
        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);
 
index 0cccf7d..b182f57 100644 (file)
@@ -2252,8 +2252,7 @@ static void save_file_cb (TextView *textview, guint action, void *data)
        
        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);
        }
 
index 36e76fe..27fc83f 100644 (file)
@@ -653,10 +653,8 @@ void toolbar_clear_list(ToolbarType source)
                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);
@@ -1931,8 +1929,7 @@ void toolbar_main_set_sensitive(gpointer data)
        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);
        }