Re: [PATCH 1/5] util: convenience function to create gmime stream for stdout

Subject: Re: [PATCH 1/5] util: convenience function to create gmime stream for stdout

Date: Sun, 21 May 2017 10:28:47 -0300

To: notmuch@notmuchmail.org, notmuch@freelists.org

Cc:

From: David Bremner


David Bremner <david@tethera.net> 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.

Thread: