From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 7C8216DE14FC for ; Sat, 18 Mar 2017 10:50:52 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.005 X-Spam-Level: X-Spam-Status: No, score=-0.005 tagged_above=-999 required=5 tests=[AWL=0.006, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id K7N5tyvKx3OF for ; Sat, 18 Mar 2017 10:50:50 -0700 (PDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTPS id A78946DE1697 for ; Sat, 18 Mar 2017 10:50:50 -0700 (PDT) Received: from remotemail by fethera.tethera.net with local (Exim 4.84_2) (envelope-from ) id 1cpIUQ-0001Oo-MQ; Sat, 18 Mar 2017 13:50:06 -0400 Received: (nullmailer pid 15967 invoked by uid 1000); Sat, 18 Mar 2017 17:50:46 -0000 From: David Bremner To: notmuch@notmuchmail.org Subject: [PATCH 6/6] cli/show: unref crlf filter. Date: Sat, 18 Mar 2017 14:50:38 -0300 Message-Id: <20170318175038.15887-7-david@tethera.net> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170318175038.15887-1-david@tethera.net> References: <20170318175038.15887-1-david@tethera.net> X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Mar 2017 17:50:52 -0000 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