Commit b0eca85e authored by Milan Crha's avatar Milan Crha
Browse files

Fix a memory leak when replying to a message

parent ea33b6c6
......@@ -1271,6 +1271,7 @@ mail_reader_reply_message_parsed (GObject *object,
context->reply_type, context->reply_style,
part_list, context->address);
g_object_unref (part_list);
async_context_free (context);
}
......@@ -1396,10 +1397,12 @@ e_mail_reader_reply_to_message (EMailReader *reader,
g_object_ref (src_message);
g_object_unref (part_list);
part_list = NULL;
g_return_if_fail (src_message != NULL);
} else {
g_object_unref (part_list);
part_list = NULL;
}
if (!e_web_view_is_selection_active (web_view))
......
......@@ -1290,7 +1290,7 @@ em_utils_message_to_html (CamelSession *session,
guint32 *validity_found)
{
EMailFormatter *formatter;
EMailParser *parser;
EMailParser *parser = NULL;
CamelStream *mem;
GByteArray *buf;
EShell *shell;
......@@ -1328,6 +1328,8 @@ em_utils_message_to_html (CamelSession *session,
parser = e_mail_parser_new (session);
parts_list = e_mail_parser_parse_sync (parser, NULL, NULL, message, NULL);
} else {
g_object_ref (parts_list);
}
/* Return all found validities and possibly show hidden prefer-plain part */
......@@ -1362,6 +1364,10 @@ em_utils_message_to_html (CamelSession *session,
if (hidden_text_html_part)
hidden_text_html_part->is_hidden = TRUE;
g_object_unref (parts_list);
if (parser)
g_object_unref (parser);
if (append && *append)
camel_stream_write_string (mem, append, NULL, NULL);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment