]> git.notmuchmail.org Git - notmuch/commit
lib/message-file.c: use g_malloc () & g_free () in hash table values
authorTomi Ollila <tomi.ollila@iki.fi>
Fri, 21 Dec 2012 17:52:01 +0000 (19:52 +0200)
committerDavid Bremner <bremner@debian.org>
Mon, 24 Dec 2012 23:02:05 +0000 (19:02 -0400)
commit27dacc7947309bb8f6f84b2cd83dc7ec280576b2
treec9989f9ad5cb05068c98e0cf65096644e28e3b80
parent02a0f341dc364572792a8b8511048ef2cd160a4e
lib/message-file.c: use g_malloc () & g_free () in hash table values

The message->headers hash table values get data returned by
g_mime_utils_header_decode_text ().

The pointer returned by g_mime_utils_header_decode_text is from the
following line in rfc2047_decode_tokens

        return g_string_free (decoded, FALSE);

The docs for g_string_free say

 Frees the memory allocated for the GString. If free_segment is TRUE
 it also frees the character data. If it's FALSE, the caller gains
 ownership of the buffer and must free it after use with g_free().

The remaining frees and allocations referencing to message->headers hash
values have been changed to use g_free and g_malloc functions.

This combines and completes the changes started by David Bremner.
lib/message-file.c