remove unnecessary allocations for search bar fixing leaks reported by Martin Kluge...
authorAlfons Hoogervorst <alfons@proteus.demon.nl>
Fri, 23 Aug 2002 23:39:48 +0000 (23:39 +0000)
committerAlfons Hoogervorst <alfons@proteus.demon.nl>
Fri, 23 Aug 2002 23:39:48 +0000 (23:39 +0000)
ChangeLog.claws
configure.in
src/summaryview.c

index 77882238b57a657ab5c4c60db3990b442b9cfb54..416238f60cd34d671f9ddaa6c2cf09ed01483c5d 100644 (file)
@@ -1,3 +1,10 @@
+2002-08-25 [alfons]    0.8.1claws112
+
+       * src/summaryview.c
+               remove unnecessary allocations for search bar fixing leaks
+               reported by Martin Kluge
+               (see "[ 599451 ] Further memory leaks?")
+
 2002-08-24 [alfons]    0.8.1claws111
 
        * src/main.c
 2002-08-24 [alfons]    0.8.1claws111
 
        * src/main.c
index 9ad2fded52671f4ce89b1706b25597d83e4fca10..e07c36e6540541363314a7b0e82fd7f8b15247bb 100644 (file)
@@ -8,7 +8,7 @@ MINOR_VERSION=8
 MICRO_VERSION=1
 INTERFACE_AGE=0
 BINARY_AGE=0
 MICRO_VERSION=1
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws111
+EXTRA_VERSION=claws112
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index 80d9552d2ea21d9a31ecdc4f0a4b5a2d2287c0bc..9048d28be3d15301ad4c2ea21a28a9429725f671 100644 (file)
@@ -896,40 +896,33 @@ gboolean summary_show(SummaryView *summaryview, FolderItem *item)
                gint search_type = GPOINTER_TO_INT(gtk_object_get_user_data(
                                   GTK_OBJECT(GTK_MENU_ITEM(gtk_menu_get_active(
                                   GTK_MENU(summaryview->search_type))))));
                gint search_type = GPOINTER_TO_INT(gtk_object_get_user_data(
                                   GTK_OBJECT(GTK_MENU_ITEM(gtk_menu_get_active(
                                   GTK_MENU(summaryview->search_type))))));
-               gchar *search_string = g_strdup(gtk_entry_get_text(
-                                      GTK_ENTRY(summaryview->search_string)));
+               gchar *search_string = gtk_entry_get_text(GTK_ENTRY(summaryview->search_string));
                gchar *searched_header = NULL;
                
                not_killed = NULL;
                gchar *searched_header = NULL;
                
                not_killed = NULL;
-               if(search_string)
-                       g_strdown(search_string);
-
-               for(cur = mlist ; cur != NULL ; cur = g_slist_next(cur)) {
+               for (cur = mlist ; cur != NULL ; cur = g_slist_next(cur)) {
                        MsgInfo * msginfo = (MsgInfo *) cur->data;
                        MsgInfo * msginfo = (MsgInfo *) cur->data;
+
                        switch (search_type) {
                        switch (search_type) {
-                               case S_SEARCH_SUBJECT:
-                                       searched_header = g_strdup(msginfo->subject);
-                                       break;
-                               case S_SEARCH_FROM:
-                                       searched_header = g_strdup(msginfo->from);
-                                       break;
-                               case S_SEARCH_TO:
-                                       searched_header = g_strdup(msginfo->to);
-                                       break;
-                               default:
-                                       printf("bug in search_type (=%d)\n",search_type);
+                       case S_SEARCH_SUBJECT:
+                               searched_header = msginfo->subject;
+                               break;
+                       case S_SEARCH_FROM:
+                               searched_header = msginfo->from;
+                               break;
+                       case S_SEARCH_TO:
+                               searched_header = msginfo->to;
+                               break;
+                       default:
+                               debug_print("unknown search type (%d)\n", search_type);
+                               break;
                        }
                        }
-                       if (searched_header) 
-                               g_strdown(searched_header);
-                       if (searched_header 
-                           && strstr(searched_header, search_string) != NULL)
+                       if (searched_header && strcasestr(searched_header, search_string) != NULL)
                                not_killed = g_slist_append(not_killed, msginfo);
                        else
                                procmsg_msginfo_free(msginfo);
                }
                g_slist_free(mlist);
                                not_killed = g_slist_append(not_killed, msginfo);
                        else
                                procmsg_msginfo_free(msginfo);
                }
                g_slist_free(mlist);
-               g_free(search_string);
-               g_free(searched_header);
                mlist = not_killed;
        }
        
                mlist = not_killed;
        }