Re: emacs email appears empty
[notmuch-archives.git] / 04 / 53482094998ce4655ea9b889977cb6612d7ef5
1 Return-Path: <jrollins@servo.finestructure.net>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id 42ECB431FD0\r
6         for <notmuch@notmuchmail.org>; Sat, 28 May 2011 14:52:29 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -1.921\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-1.921 tagged_above=-999 required=5\r
12         tests=[NO_DNS_FOR_FROM=0.379, RCVD_IN_DNSWL_MED=-2.3]\r
13         autolearn=disabled\r
14 Received: from olra.theworths.org ([127.0.0.1])\r
15         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
16         with ESMTP id Ffk8bT8+hicL for <notmuch@notmuchmail.org>;\r
17         Sat, 28 May 2011 14:52:28 -0700 (PDT)\r
18 Received: from outgoing-mail.its.caltech.edu (outgoing-mail.its.caltech.edu\r
19         [131.215.239.19])\r
20         by olra.theworths.org (Postfix) with ESMTP id 9E371429E29\r
21         for <notmuch@notmuchmail.org>; Sat, 28 May 2011 14:52:16 -0700 (PDT)\r
22 Received: from earth-doxen.imss.caltech.edu (localhost [127.0.0.1])\r
23         by earth-doxen-postvirus (Postfix) with ESMTP id 2356D66E0343;\r
24         Sat, 28 May 2011 14:52:15 -0700 (PDT)\r
25 X-Spam-Scanned: at Caltech-IMSS on earth-doxen by amavisd-new\r
26 Received: from servo.finestructure.net (cpe-98-149-172-122.socal.res.rr.com\r
27         [98.149.172.122]) (Authenticated sender: jrollins)\r
28         by earth-doxen-submit (Postfix) with ESMTP id 5CC6066E024E;\r
29         Sat, 28 May 2011 14:52:11 -0700 (PDT)\r
30 Received: by servo.finestructure.net (Postfix, from userid 1000)\r
31         id 47435816; Sat, 28 May 2011 14:52:05 -0700 (PDT)\r
32 From: Jameson Graef Rollins <jrollins@finestructure.net>\r
33 To: Notmuch Mail <notmuch@notmuchmail.org>\r
34 Subject: [PATCH 16/25] lib/message-file: plug three memleaks.\r
35 Date: Sat, 28 May 2011 14:51:51 -0700\r
36 Message-Id: <1306619520-25730-17-git-send-email-jrollins@finestructure.net>\r
37 X-Mailer: git-send-email 1.7.4.4\r
38 In-Reply-To: <1306619520-25730-16-git-send-email-jrollins@finestructure.net>\r
39 References: <1306619520-25730-1-git-send-email-jrollins@finestructure.net>\r
40         <1306619520-25730-2-git-send-email-jrollins@finestructure.net>\r
41         <1306619520-25730-3-git-send-email-jrollins@finestructure.net>\r
42         <1306619520-25730-4-git-send-email-jrollins@finestructure.net>\r
43         <1306619520-25730-5-git-send-email-jrollins@finestructure.net>\r
44         <1306619520-25730-6-git-send-email-jrollins@finestructure.net>\r
45         <1306619520-25730-7-git-send-email-jrollins@finestructure.net>\r
46         <1306619520-25730-8-git-send-email-jrollins@finestructure.net>\r
47         <1306619520-25730-9-git-send-email-jrollins@finestructure.net>\r
48         <1306619520-25730-10-git-send-email-jrollins@finestructure.net>\r
49         <1306619520-25730-11-git-send-email-jrollins@finestructure.net>\r
50         <1306619520-25730-12-git-send-email-jrollins@finestructure.net>\r
51         <1306619520-25730-13-git-send-email-jrollins@finestructure.net>\r
52         <1306619520-25730-14-git-send-email-jrollins@finestructure.net>\r
53         <1306619520-25730-15-git-send-email-jrollins@finestructure.net>\r
54         <1306619520-25730-16-git-send-email-jrollins@finestructure.net>\r
55 X-BeenThere: notmuch@notmuchmail.org\r
56 X-Mailman-Version: 2.1.13\r
57 Precedence: list\r
58 List-Id: "Use and development of the notmuch mail system."\r
59         <notmuch.notmuchmail.org>\r
60 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
61         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
62 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
63 List-Post: <mailto:notmuch@notmuchmail.org>\r
64 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
65 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
66         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
67 X-List-Received-Date: Sat, 28 May 2011 21:52:29 -0000\r
68 \r
69 From: Anton Khirnov <anton@khirnov.net>\r
70 \r
71 Signed-off-by: Jameson Graef Rollins <jrollins@finestructure.net>\r
72 ---\r
73  lib/message-file.c |    5 +++++\r
74  1 files changed, 5 insertions(+), 0 deletions(-)\r
75 \r
76 diff --git a/lib/message-file.c b/lib/message-file.c\r
77 index 7722832..99505c1 100644\r
78 --- a/lib/message-file.c\r
79 +++ b/lib/message-file.c\r
80 @@ -341,12 +341,17 @@ notmuch_message_file_get_header (notmuch_message_file_t *message,\r
81                 strncpy(combined_header,header_sofar,hdrsofar);\r
82                 *(combined_header+hdrsofar) = ' ';\r
83                 strncpy(combined_header+hdrsofar+1,decoded_value,newhdr+1);\r
84 +               free (decoded_value);\r
85                 g_hash_table_insert (message->headers, header, combined_header);\r
86             }\r
87         } else {\r
88             if (header_sofar == NULL) {\r
89                 /* Only insert if we don't have a value for this header, yet. */\r
90                 g_hash_table_insert (message->headers, header, decoded_value);\r
91 +           } else {\r
92 +               free (header);\r
93 +               free (decoded_value);\r
94 +               decoded_value = header_sofar;\r
95             }\r
96         }\r
97         /* if we found a match we can bail - unless of course we are\r
98 -- \r
99 1.7.4.4\r
100 \r