From: Alberto Garcia Date: Thu, 6 Mar 2008 11:45:41 +0000 (+0000) Subject: * src/modest-formatter.c X-Git-Tag: git_migration_finished~1582 X-Git-Url: http://git.maemo.org/git/?p=modest;a=commitdiff_plain;h=5c5a1ed820c6cd173a562590974a207168fc8ba3;hp=147112f44ee59e59faaa71eecf76888c17ee0ece * src/modest-formatter.c (construct_from_text) Fix a memory leak building the TnyStream * src/modest-tny-msg.c (add_body_part) (add_html_body_part): Fix a memory leak building the TnyStream pmo-trunk-r4283 --- diff --git a/src/modest-formatter.c b/src/modest-formatter.c index ed10222..932c99c 100644 --- a/src/modest-formatter.c +++ b/src/modest-formatter.c @@ -32,8 +32,7 @@ #include #include #include -#include -#include +#include #include "modest-formatter.h" #include "modest-text-utils.h" #include "modest-tny-platform-factory.h" @@ -108,9 +107,8 @@ construct_from_text (TnyMimePart *part, TnyStream *text_body_stream; /* Create the stream */ - text_body_stream = TNY_STREAM (tny_camel_stream_new - (camel_stream_mem_new_with_buffer - (text, strlen(text)))); + text_body_stream = TNY_STREAM (tny_camel_mem_stream_new_with_buffer + (text, strlen(text))); /* Construct MIME part */ tny_stream_reset (text_body_stream); diff --git a/src/modest-tny-msg.c b/src/modest-tny-msg.c index a5be76f..e521233 100644 --- a/src/modest-tny-msg.c +++ b/src/modest-tny-msg.c @@ -34,10 +34,8 @@ #include #include #include "modest-formatter.h" -#include +#include #include -#include -#include #include #include #include "modest-tny-mime-part.h" @@ -171,9 +169,8 @@ add_body_part (TnyMsg *msg, TnyStream *text_body_stream; /* Create the stream */ - text_body_stream = TNY_STREAM (tny_camel_stream_new - (camel_stream_mem_new_with_buffer - (body, (body ? strlen(body) : 0)))); + text_body_stream = TNY_STREAM (tny_camel_mem_stream_new_with_buffer + (body, (body ? strlen(body) : 0))); text_body_part = modest_formatter_create_body_part (NULL, msg); @@ -200,9 +197,8 @@ add_html_body_part (TnyMsg *msg, TnyStream *html_body_stream; /* Create the stream */ - html_body_stream = TNY_STREAM (tny_camel_stream_new - (camel_stream_mem_new_with_buffer - (body, strlen(body)))); + html_body_stream = TNY_STREAM (tny_camel_mem_stream_new_with_buffer + (body, strlen(body))); /* Create body part if needed */ html_body_part = modest_formatter_create_body_part (NULL, msg);