PATCH: anti memleak part 3



jo, subject says everything. please REVIEW the patch before
applying to CVS..

-- 
Name....: Ali Akcaagac
Status..: Student Of Computer & Economic Science
E-Mail..: mailto:ali.akcaagac@stud.fh-wilhelmshaven.de
WWW.....: http://www.fh-wilhelmshaven.de/~akcaagaa
diff -ruN balsa-cvs/src/balsa-message.c balsa/src/balsa-message.c
--- balsa-cvs/src/balsa-message.c	Thu Oct 18 16:38:15 2001
+++ balsa/src/balsa-message.c	Thu Oct 18 18:30:20 2001
@@ -1,5 +1,4 @@
 /* -*-mode:c; c-style:k&r; c-basic-offset:4; -*- */
-/* vim:set ts=4 sw=4 ai et: */
 /* Balsa E-Mail Client
  * Copyright (C) 1997-2001 Stuart Parmenter and others,
  *                         See the file AUTHORS for a list.
@@ -322,7 +321,7 @@
 static void
 save_dialog_ok(GtkWidget* button, GtkWidget* save_dialog)
 {
-    gchar *filename;
+    gchar *filename = NULL;
     gboolean do_save, result;
     BalsaPartInfo * info;
 
@@ -361,6 +360,10 @@
 	    gnome_dialog_run_and_close(GNOME_DIALOG(msgbox));
 	}
     }
+
+    if (filename != NULL)
+	g_free(filename);
+
     gtk_object_destroy(GTK_OBJECT(save_dialog));
 }
 
@@ -852,7 +855,7 @@
     GtkWidget *vbox;
     GtkWidget *button;
     GString *msg = NULL;
-    gchar *url;
+    gchar *url = NULL;
 
     if (url_type == RFC2046_EXTBODY_LOCALFILE) {
 	gchar *local_name;
@@ -940,6 +943,9 @@
     info->focus_widget = vbox;
     info->widget = vbox;
     info->can_display = FALSE;    
+
+    if (url != NULL)
+	g_free(url);
 }
 
 static void
@@ -1755,6 +1761,7 @@
 	}
     }
 
+    g_list_free(hotarea_list);
     return FALSE;
 }
 
@@ -2199,6 +2206,7 @@
     
     g_return_if_fail(url);
     gnome_url_show(url);
+    g_free(url);
 }
 
 
@@ -2269,7 +2277,6 @@
     const gchar *cmd;
     gchar* key;
 
-
     content_type = libbalsa_message_body_get_content_type(info->body);
     key = gtk_object_get_data (GTK_OBJECT (menu_item), "mime_action");
 
@@ -2294,6 +2301,7 @@
     } else
 	fprintf(stderr, "view for %s returned NULL\n", content_type);
 
+    g_free(key);
     g_free(content_type);
 }
 
@@ -2375,7 +2383,6 @@
 	g_free(content_type);
     }
 
-
     return parts;
 }
 
diff -ruN balsa-cvs/src/main-window.c balsa/src/main-window.c
--- balsa-cvs/src/main-window.c	Thu Oct 18 16:38:15 2001
+++ balsa/src/main-window.c	Thu Oct 18 18:14:43 2001
@@ -1,5 +1,4 @@
 /* -*-mode:c; c-style:k&r; c-basic-offset:4; -*- */
-/* vim:set ts=4 sw=4 ai et: */
 /* Balsa E-Mail Client
  * Copyright (C) 1997-2001 Stuart Parmenter and others,
  *                         See the file AUTHORS for a list.
@@ -1546,6 +1545,8 @@
         }
         list = g_list_next(list);
     }
+
+    g_list_free (list);
 }
 
 /* Check all mailboxes in a list
@@ -1568,6 +1569,8 @@
 
         list = g_list_next(list);
     }
+
+    g_list_free (list);
 }
 
 /*Callback to check a mailbox in a balsa-mblist */
@@ -2962,7 +2965,6 @@
     guint activity_counter = 0;
     GtkProgress* progress_bar;
     GtkAdjustment* adj;
-    
 
     progress_bar = gnome_appbar_get_progress(
         GNOME_APPBAR(GNOME_APP(window)->statusbar));
@@ -3079,7 +3081,6 @@
     gint in_use;
     GtkProgress* progress_bar;
     GtkAdjustment* adj;
-    
 
     progress_bar = gnome_appbar_get_progress(
         GNOME_APPBAR(GNOME_APP(window)->statusbar));
diff -ruN balsa-cvs/src/pref-manager.c balsa/src/pref-manager.c
--- balsa-cvs/src/pref-manager.c	Thu Oct 18 16:38:15 2001
+++ balsa/src/pref-manager.c	Thu Oct 18 18:00:17 2001
@@ -1,5 +1,4 @@
 /* -*-mode:c; c-style:k&r; c-basic-offset:4; -*- */
-/* vim:set ts=4 sw=4 ai et: */
 /* Balsa E-Mail Client
  * Copyright (C) 1997-2001 Stuart Parmenter and others,
  *                         See the file AUTHORS for a list.
@@ -660,6 +659,7 @@
     entry_widget = gnome_entry_gtk_entry(GNOME_ENTRY(pui->quote_pattern));
     tmp = gtk_entry_get_text(GTK_ENTRY(entry_widget));
     balsa_app.quote_regex = libbalsa_deescape_specials(tmp);
+    g_free(tmp);
 
     balsa_app.browse_wrap = GTK_TOGGLE_BUTTON(pui->browse_wrap)->active;
     /* main window view menu can also toggle balsa_app.browse_wrap
@@ -2203,7 +2203,7 @@
 static void
 font_changed(GtkWidget * widget, GtkWidget * pbox)
 {
-    gchar *font;
+    gchar *font = NULL;
     GtkWidget *peer;
     if (GNOME_IS_FONT_PICKER(widget)) {
 	font = gnome_font_picker_get_font_name(GNOME_FONT_PICKER(widget));
@@ -2215,6 +2215,9 @@
 	gnome_font_picker_set_font_name(GNOME_FONT_PICKER(peer), font);
 	properties_modified_cb(widget, pbox);
     }
+
+    if (font != NULL)
+	g_free (font);
 }
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]