[PATCH] fix memory leaks in notmuch-show.c:format_headers_sprinter()

Jeffrey Stedfast jestedfa at microsoft.com
Thu Mar 16 09:53:47 PDT 2017

Hey guys,

Was just grepping through notmuch sources and discovered what I think are memory leaks in notmuch-show.c’s format_headers_sprinter() code.

Internet_address_list_to_string() and g_mime_message_get_date_as_string() return allocated string buffers and not const, so from what I can tell from taking a look at the sprinter-sexp.c’s sexp_string() function, the code leaks the recipients_string as well as the date string.

Attached is a patch which fixes these leaks.

Hope this helps,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: memleak-fixes.patch
Type: application/octet-stream
Size: 1747 bytes
Desc: memleak-fixes.patch
URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20170316/cc8489b6/attachment-0001.obj>

More information about the notmuch mailing list