mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-25 04:18:08 +01:00
lib/message-file: plug three memleaks.
Signed-off-by: Jameson Graef Rollins <jrollins@finestructure.net>
This commit is contained in:
parent
a0f09b4942
commit
d3fdb76c8d
1 changed files with 5 additions and 0 deletions
|
@ -341,12 +341,17 @@ notmuch_message_file_get_header (notmuch_message_file_t *message,
|
||||||
strncpy(combined_header,header_sofar,hdrsofar);
|
strncpy(combined_header,header_sofar,hdrsofar);
|
||||||
*(combined_header+hdrsofar) = ' ';
|
*(combined_header+hdrsofar) = ' ';
|
||||||
strncpy(combined_header+hdrsofar+1,decoded_value,newhdr+1);
|
strncpy(combined_header+hdrsofar+1,decoded_value,newhdr+1);
|
||||||
|
free (decoded_value);
|
||||||
g_hash_table_insert (message->headers, header, combined_header);
|
g_hash_table_insert (message->headers, header, combined_header);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (header_sofar == NULL) {
|
if (header_sofar == NULL) {
|
||||||
/* Only insert if we don't have a value for this header, yet. */
|
/* Only insert if we don't have a value for this header, yet. */
|
||||||
g_hash_table_insert (message->headers, header, decoded_value);
|
g_hash_table_insert (message->headers, header, decoded_value);
|
||||||
|
} else {
|
||||||
|
free (header);
|
||||||
|
free (decoded_value);
|
||||||
|
decoded_value = header_sofar;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* if we found a match we can bail - unless of course we are
|
/* if we found a match we can bail - unless of course we are
|
||||||
|
|
Loading…
Reference in a new issue