[PATCH 6/6] cli/show: unref crlf filter.

David Bremner david at tethera.net
Sat Mar 18 10:50:38 PDT 2017


Mimic the handling of the other filter g_objects. This cleans up a
fair sized memory leak.
---
 notmuch-show.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/notmuch-show.c b/notmuch-show.c
index 43ee9021..7451d5ab 100644
--- a/notmuch-show.c
+++ b/notmuch-show.c
@@ -276,6 +276,7 @@ show_text_part_content (GMimeObject *part, GMimeStream *stream_out,
 {
     GMimeContentType *content_type = g_mime_object_get_content_type (GMIME_OBJECT (part));
     GMimeStream *stream_filter = NULL;
+    GMimeFilter *crlf_filter = NULL;
     GMimeDataWrapper *wrapper;
     const char *charset;
 
@@ -287,8 +288,10 @@ show_text_part_content (GMimeObject *part, GMimeStream *stream_out,
 	return;
 
     stream_filter = g_mime_stream_filter_new (stream_out);
+    crlf_filter = g_mime_filter_crlf_new (FALSE, FALSE);
     g_mime_stream_filter_add(GMIME_STREAM_FILTER (stream_filter),
-			     g_mime_filter_crlf_new (FALSE, FALSE));
+			     crlf_filter);
+    g_object_unref (crlf_filter);
 
     charset = g_mime_object_get_content_type_parameter (part, "charset");
     if (charset) {
-- 
2.11.0



More information about the notmuch mailing list