[PATCH 16/25] lib/message-file: plug three memleaks.
authorJameson Graef Rollins <jrollins@finestructure.net>
Sat, 28 May 2011 21:51:51 +0000 (14:51 +1700)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:38:26 +0000 (09:38 -0800)
04/53482094998ce4655ea9b889977cb6612d7ef5 [new file with mode: 0644]

diff --git a/04/53482094998ce4655ea9b889977cb6612d7ef5 b/04/53482094998ce4655ea9b889977cb6612d7ef5
new file mode 100644 (file)
index 0000000..17f9e52
--- /dev/null
@@ -0,0 +1,100 @@
+Return-Path: <jrollins@servo.finestructure.net>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 42ECB431FD0\r
+       for <notmuch@notmuchmail.org>; Sat, 28 May 2011 14:52:29 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -1.921\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-1.921 tagged_above=-999 required=5\r
+       tests=[NO_DNS_FOR_FROM=0.379, RCVD_IN_DNSWL_MED=-2.3]\r
+       autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id Ffk8bT8+hicL for <notmuch@notmuchmail.org>;\r
+       Sat, 28 May 2011 14:52:28 -0700 (PDT)\r
+Received: from outgoing-mail.its.caltech.edu (outgoing-mail.its.caltech.edu\r
+       [131.215.239.19])\r
+       by olra.theworths.org (Postfix) with ESMTP id 9E371429E29\r
+       for <notmuch@notmuchmail.org>; Sat, 28 May 2011 14:52:16 -0700 (PDT)\r
+Received: from earth-doxen.imss.caltech.edu (localhost [127.0.0.1])\r
+       by earth-doxen-postvirus (Postfix) with ESMTP id 2356D66E0343;\r
+       Sat, 28 May 2011 14:52:15 -0700 (PDT)\r
+X-Spam-Scanned: at Caltech-IMSS on earth-doxen by amavisd-new\r
+Received: from servo.finestructure.net (cpe-98-149-172-122.socal.res.rr.com\r
+       [98.149.172.122]) (Authenticated sender: jrollins)\r
+       by earth-doxen-submit (Postfix) with ESMTP id 5CC6066E024E;\r
+       Sat, 28 May 2011 14:52:11 -0700 (PDT)\r
+Received: by servo.finestructure.net (Postfix, from userid 1000)\r
+       id 47435816; Sat, 28 May 2011 14:52:05 -0700 (PDT)\r
+From: Jameson Graef Rollins <jrollins@finestructure.net>\r
+To: Notmuch Mail <notmuch@notmuchmail.org>\r
+Subject: [PATCH 16/25] lib/message-file: plug three memleaks.\r
+Date: Sat, 28 May 2011 14:51:51 -0700\r
+Message-Id: <1306619520-25730-17-git-send-email-jrollins@finestructure.net>\r
+X-Mailer: git-send-email 1.7.4.4\r
+In-Reply-To: <1306619520-25730-16-git-send-email-jrollins@finestructure.net>\r
+References: <1306619520-25730-1-git-send-email-jrollins@finestructure.net>\r
+       <1306619520-25730-2-git-send-email-jrollins@finestructure.net>\r
+       <1306619520-25730-3-git-send-email-jrollins@finestructure.net>\r
+       <1306619520-25730-4-git-send-email-jrollins@finestructure.net>\r
+       <1306619520-25730-5-git-send-email-jrollins@finestructure.net>\r
+       <1306619520-25730-6-git-send-email-jrollins@finestructure.net>\r
+       <1306619520-25730-7-git-send-email-jrollins@finestructure.net>\r
+       <1306619520-25730-8-git-send-email-jrollins@finestructure.net>\r
+       <1306619520-25730-9-git-send-email-jrollins@finestructure.net>\r
+       <1306619520-25730-10-git-send-email-jrollins@finestructure.net>\r
+       <1306619520-25730-11-git-send-email-jrollins@finestructure.net>\r
+       <1306619520-25730-12-git-send-email-jrollins@finestructure.net>\r
+       <1306619520-25730-13-git-send-email-jrollins@finestructure.net>\r
+       <1306619520-25730-14-git-send-email-jrollins@finestructure.net>\r
+       <1306619520-25730-15-git-send-email-jrollins@finestructure.net>\r
+       <1306619520-25730-16-git-send-email-jrollins@finestructure.net>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sat, 28 May 2011 21:52:29 -0000\r
+\r
+From: Anton Khirnov <anton@khirnov.net>\r
+\r
+Signed-off-by: Jameson Graef Rollins <jrollins@finestructure.net>\r
+---\r
+ lib/message-file.c |    5 +++++\r
+ 1 files changed, 5 insertions(+), 0 deletions(-)\r
+\r
+diff --git a/lib/message-file.c b/lib/message-file.c\r
+index 7722832..99505c1 100644\r
+--- a/lib/message-file.c\r
++++ b/lib/message-file.c\r
+@@ -341,12 +341,17 @@ notmuch_message_file_get_header (notmuch_message_file_t *message,\r
+               strncpy(combined_header,header_sofar,hdrsofar);\r
+               *(combined_header+hdrsofar) = ' ';\r
+               strncpy(combined_header+hdrsofar+1,decoded_value,newhdr+1);\r
++              free (decoded_value);\r
+               g_hash_table_insert (message->headers, header, combined_header);\r
+           }\r
+       } else {\r
+           if (header_sofar == NULL) {\r
+               /* Only insert if we don't have a value for this header, yet. */\r
+               g_hash_table_insert (message->headers, header, decoded_value);\r
++          } else {\r
++              free (header);\r
++              free (decoded_value);\r
++              decoded_value = header_sofar;\r
+           }\r
+       }\r
+       /* if we found a match we can bail - unless of course we are\r
+-- \r
+1.7.4.4\r
+\r