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 565B46DE0173 for ; Sun, 21 May 2017 06:28:50 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.001 X-Spam-Level: X-Spam-Status: No, score=-0.001 tagged_above=-999 required=5 tests=[AWL=0.010, 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 dvpaar4xtdmz for ; Sun, 21 May 2017 06:28:49 -0700 (PDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTPS id 655906DE0140 for ; Sun, 21 May 2017 06:28:49 -0700 (PDT) Received: from remotemail by fethera.tethera.net with local (Exim 4.84_2) (envelope-from ) id 1dCQtm-00041o-30; Sun, 21 May 2017 09:27:54 -0400 Received: (nullmailer pid 8479 invoked by uid 1000); Sun, 21 May 2017 13:28:47 -0000 From: David Bremner To: notmuch@notmuchmail.org, notmuch@freelists.org Subject: Re: [PATCH 1/5] util: convenience function to create gmime stream for stdout In-Reply-To: <20170521124821.23924-2-david@tethera.net> References: <20170521124821.23924-1-david@tethera.net> <20170521124821.23924-2-david@tethera.net> Date: Sun, 21 May 2017 10:28:47 -0300 Message-ID: <87o9umwd80.fsf@tethera.net> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.23 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: Sun, 21 May 2017 13:28:50 -0000 David Bremner writes: > +GMimeStream * > +g_mime_stream_stdout_new() > +{ > + GMimeStream *stream_stdout = NULL; > + > + stream_stdout = g_mime_stream_pipe_new (STDOUT_FILENO); > + if (!stream_stdout) > + return NULL; > + > + g_mime_stream_pipe_set_owner (GMIME_STREAM_PIPE (stream_stdout), FALSE); > + > + return g_mime_stream_buffer_new (stream_stdout, GMIME_STREAM_BUFFER_BLOCK_WRITE); > +} speaking of memory leaks, I _think_ stream_stdout is leaking here, although I can't find it with valgrind.