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

David Bremner david at tethera.net
Sun May 21 06:28:47 PDT 2017


David Bremner <david at 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.


More information about the notmuch mailing list