1 Return-Path: <amdragon@gmail.com>
\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 1720C429E20
\r
6 for <notmuch@notmuchmail.org>; Mon, 9 May 2011 05:42:18 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-0.699 tagged_above=-999 required=5
\r
12 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001,
\r
13 RCVD_IN_DNSWL_LOW=-0.7] 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 i318BnKJWidb for <notmuch@notmuchmail.org>;
\r
17 Mon, 9 May 2011 05:42:15 -0700 (PDT)
\r
18 Received: from mail-qw0-f53.google.com (mail-qw0-f53.google.com
\r
19 [209.85.216.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))
\r
20 (No client certificate requested)
\r
21 by olra.theworths.org (Postfix) with ESMTPS id 44F76431FB5
\r
22 for <notmuch@notmuchmail.org>; Mon, 9 May 2011 05:42:15 -0700 (PDT)
\r
23 Received: by qwb7 with SMTP id 7so3511587qwb.26
\r
24 for <notmuch@notmuchmail.org>; Mon, 09 May 2011 05:42:14 -0700 (PDT)
\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
\r
26 h=domainkey-signature:mime-version:sender:in-reply-to:references:date
\r
27 :x-google-sender-auth:message-id:subject:from:to:cc:content-type
\r
28 :content-transfer-encoding;
\r
29 bh=vSsEZ6oRhD2lmBkkRWSiSAIzwjQH5JKkfXwIN71an+U=;
\r
30 b=te65HGGuyXiTEEhe28nb9v+5AechgQwSXX5sUagLLJ8za1SeFs+TtoUhsCfJCGzQ5P
\r
31 gaPnyjQhLCR4F7eEtsMxLWdRFz+o2psQPMl17h64fQ/zXz0idAI9IfVFhh/kcvyNtwRy
\r
32 zQuQO9c+IwDkdgJT4b55qAmNxMtRu0C1mk7Y8=
\r
33 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
\r
34 h=mime-version:sender:in-reply-to:references:date
\r
35 :x-google-sender-auth:message-id:subject:from:to:cc:content-type
\r
36 :content-transfer-encoding;
\r
37 b=jUk+Y0gJOygXVHq69E9cu2GTwMxng9SFJrOs/04T+jMfkrpUYxHSecvXBUzCK4O9kj
\r
38 3iawPHkaz+BQFRvIoYMWS+vZ+p+xb8X3tEwygx9C0rn0pGXEBaoZkpGOq/Qth9RscRjX
\r
39 L0/Sdahrtzv0bSFzPa/WqU6C6OGccD3rlQT2A=
\r
41 Received: by 10.229.127.144 with SMTP id g16mr5022481qcs.152.1304944934658;
\r
42 Mon, 09 May 2011 05:42:14 -0700 (PDT)
\r
43 Sender: amdragon@gmail.com
\r
44 Received: by 10.229.233.17 with HTTP; Mon, 9 May 2011 05:42:14 -0700 (PDT)
\r
45 In-Reply-To: <20110509064645.2B6AD7F508@zohar.localdomain>
\r
46 References: <1302878638-17634-1-git-send-email-anton@khirnov.net>
\r
47 <20110509064645.2B6AD7F508@zohar.localdomain>
\r
48 Date: Mon, 9 May 2011 08:42:14 -0400
\r
49 X-Google-Sender-Auth: keltB0nPwr4026734UnS_-AYsN4
\r
50 Message-ID: <BANLkTikudNN6b53XfeTiSkQzUv1pouexTg@mail.gmail.com>
\r
51 Subject: Re: [PATCH] lib/message-file: plug three memleaks.
\r
52 From: Austin Clements <amdragon@mit.edu>
\r
53 To: Anton Khirnov <anton@khirnov.net>
\r
54 Content-Type: text/plain; charset=ISO-8859-1
\r
55 Content-Transfer-Encoding: quoted-printable
\r
56 Cc: notmuch@notmuchmail.org
\r
57 X-BeenThere: notmuch@notmuchmail.org
\r
58 X-Mailman-Version: 2.1.13
\r
60 List-Id: "Use and development of the notmuch mail system."
\r
61 <notmuch.notmuchmail.org>
\r
62 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
63 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
64 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
65 List-Post: <mailto:notmuch@notmuchmail.org>
\r
66 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
67 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
68 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
69 X-List-Received-Date: Mon, 09 May 2011 12:42:18 -0000
\r
71 Cool. This looks like a pretty nasty leak and I'm pretty sure your
\r
72 patch is correct (though it took me a while to convince myself!).
\r
74 My one nit is code style. There should be a space between the
\r
75 function name and the paren. (Oddly, the is_received handling that
\r
76 you changed is the only place in notmuch where I've seen this style
\r
77 violated; but there's no sense in spreading this inconsistency.)
\r
79 On Mon, May 9, 2011 at 2:46 AM, Anton Khirnov <anton@khirnov.net> wrote:
\r
80 > On Fri, 15 Apr 2011 16:43:58 +0200, Anton Khirnov <anton@khirnov.net> wro=
\r
83 >> =A0lib/message-file.c | =A0 =A05 +++++
\r
84 >> =A01 files changed, 5 insertions(+), 0 deletions(-)
\r
86 >> diff --git a/lib/message-file.c b/lib/message-file.c
\r
87 >> index 7722832..b7b3286 100644
\r
88 >> --- a/lib/message-file.c
\r
89 >> +++ b/lib/message-file.c
\r
90 >> @@ -341,12 +341,17 @@ notmuch_message_file_get_header (notmuch_message_f=
\r
92 >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 strncpy(combined_header,header_sofar,hdrsofa=
\r
94 >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 *(combined_header+hdrsofar) =3D ' ';
\r
95 >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 strncpy(combined_header+hdrsofar+1,decoded_v=
\r
97 >> + =A0 =A0 =A0 =A0 =A0 =A0 free(decoded_value);
\r
98 >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 g_hash_table_insert (message->headers, heade=
\r
99 r, combined_header);
\r
100 >> =A0 =A0 =A0 =A0 =A0 }
\r
101 >> =A0 =A0 =A0 } else {
\r
102 >> =A0 =A0 =A0 =A0 =A0 if (header_sofar =3D=3D NULL) {
\r
103 >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* Only insert if we don't have a value for =
\r
104 this header, yet. */
\r
105 >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 g_hash_table_insert (message->headers, heade=
\r
107 >> + =A0 =A0 =A0 =A0 } else {
\r
108 >> + =A0 =A0 =A0 =A0 =A0 =A0 free(header);
\r
109 >> + =A0 =A0 =A0 =A0 =A0 =A0 free(decoded_value);
\r
110 >> + =A0 =A0 =A0 =A0 =A0 =A0 decoded_value =3D header_sofar;
\r
111 >> =A0 =A0 =A0 =A0 =A0 }
\r
113 >> =A0 =A0 =A0 /* if we found a match we can bail - unless of course we are
\r
117 >> _______________________________________________
\r
118 >> notmuch mailing list
\r
119 >> notmuch@notmuchmail.org
\r
120 >> http://notmuchmail.org/mailman/listinfo/notmuch
\r
126 > _______________________________________________
\r
127 > notmuch mailing list
\r
128 > notmuch@notmuchmail.org
\r
129 > http://notmuchmail.org/mailman/listinfo/notmuch
\r