[evolution-rss] Bug 703923 - Memory leak from e_mail_part_ref_mime_part()



commit e4b347be424df1d2391989290e0a6008d6f312b9
Author: Lucian Langa <lucilanga gnome org>
Date:   Fri Aug 30 14:30:17 2013 +0200

    Bug 703923 - Memory leak from e_mail_part_ref_mime_part()

 src/e-mail-formatter-evolution-rss.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/src/e-mail-formatter-evolution-rss.c b/src/e-mail-formatter-evolution-rss.c
index fa87178..f77ff44 100644
--- a/src/e-mail-formatter-evolution-rss.c
+++ b/src/e-mail-formatter-evolution-rss.c
@@ -110,12 +110,12 @@ emfe_evolution_rss_format (EMailFormatterExtension *extension,
        CamelContentType *ct = camel_mime_part_get_content_type (message);
        if (ct) {
                if (!camel_content_type_is (ct, "x-evolution", "evolution-rss-feed"))
-                       return FALSE;
+                       goto fail;
        }
 
        dw = camel_medium_get_content (CAMEL_MEDIUM (message));
        if (!dw) {
-               return FALSE;
+               goto fail;
        }
 
        str = g_strdup_printf (
@@ -232,7 +232,7 @@ emfe_evolution_rss_format (EMailFormatterExtension *extension,
                        camel_stream_write_string (stream, "<h3>Error!</h3>", cancellable, NULL);
                        camel_stream_write_string (stream, err->message, cancellable, NULL);
                        camel_stream_write_string (stream, "</div>", cancellable, NULL);
-                       return TRUE;
+                       goto success;
                }
 
                gchar *buff = rss_process_website(content->str, website);
@@ -275,7 +275,11 @@ emfe_evolution_rss_format (EMailFormatterExtension *extension,
        g_idle_add((GSourceFunc)feed_async, hd);
        }
 
+success:g_object_unref(message);
        return TRUE;
+fail:
+       g_object_unref(message);
+       return FALSE;
 }
 
 static void


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