[balsa] Do not leak HTML source



commit deacd6bb0ab6ab557a3c0b66be2741446a6a38b4
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Wed Jan 6 09:15:52 2010 -0500

    Do not leak HTML source

 ChangeLog                    |    5 +++++
 src/balsa-mime-widget-text.c |    6 +++++-
 2 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 2a9cdf8..9497925 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,11 @@
 	* libbalsa/imap/imap_compress.c: improve error handling.
 	* libbalsa/mailbox_imap.c: catch error conditions early.
 
+2010-01-06  Peter Bloomfield
+
+	* src/balsa-mime-widget-text.c (balsa_mime_widget_new_text): do
+	not leak HTML source.
+
 2010-01-05  Pawel Salek
 
 	* libbalsa/imap/siobuf.[ch]: change encode interface so that
diff --git a/src/balsa-mime-widget-text.c b/src/balsa-mime-widget-text.c
index 75e8fd4..b5aacfa 100644
--- a/src/balsa-mime-widget-text.c
+++ b/src/balsa-mime-widget-text.c
@@ -163,6 +163,8 @@ balsa_mime_widget_new_text(BalsaMessage * bm, LibBalsaMessageBody * mime_body,
     html_type = libbalsa_html_type(content_type);
     if (html_type) {
 #ifdef HAVE_GTKHTML
+        BalsaMimeWidget *html_widget;
+
 	alloced = libbalsa_html_filter(html_type, &ptr, alloced);
 	/* Force vertical scrollbar while we render the html, otherwise
 	 * the widget will make itself too wide to accept one, forcing
@@ -170,7 +172,9 @@ balsa_mime_widget_new_text(BalsaMessage * bm, LibBalsaMessageBody * mime_body,
         gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(bm->scroll),
                                        GTK_POLICY_AUTOMATIC,
                                        GTK_POLICY_ALWAYS);
-        return bm_widget_new_html(bm, mime_body, ptr, alloced);
+        html_widget = bm_widget_new_html(bm, mime_body, ptr, alloced);
+        g_free(ptr);
+        return html_widget;
 #else
 	g_free(ptr);
         return NULL;



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