1 Return-Path: <cworth@cworth.org>
\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 4AC1440DACE
\r
6 for <notmuch@notmuchmail.org>; Mon, 8 Nov 2010 09:20:05 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-2.89 tagged_above=-999 required=5
\r
12 tests=[ALL_TRUSTED=-1, BAYES_00=-1.9, T_MIME_NO_TEXT=0.01]
\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 crZTeFN5BWxm; Mon, 8 Nov 2010 09:19:55 -0800 (PST)
\r
17 Received: from yoom.home.cworth.org (localhost [127.0.0.1])
\r
18 by olra.theworths.org (Postfix) with ESMTP id 1355740DAC4;
\r
19 Mon, 8 Nov 2010 09:19:53 -0800 (PST)
\r
20 Received: by yoom.home.cworth.org (Postfix, from userid 1000)
\r
21 id 13AA225412B; Mon, 8 Nov 2010 09:19:50 -0800 (PST)
\r
22 From: Carl Worth <cworth@cworth.org>
\r
23 To: Michael Forney <mforney@mforney.org>, notmuch@notmuchmail.org
\r
24 Subject: Re: [PATCH] lib: Fix memory leaks in notmuch_message_file_get_header
\r
25 In-Reply-To: <1288928975-10041-1-git-send-email-mforney@mforney.org>
\r
26 References: <1288928975-10041-1-git-send-email-mforney@mforney.org>
\r
27 User-Agent: Notmuch/0.4 (http://notmuchmail.org) Emacs/23.2.1
\r
29 Date: Mon, 08 Nov 2010 09:19:49 -0800
\r
30 Message-ID: <877hgnohqi.fsf@yoom.home.cworth.org>
\r
32 Content-Type: multipart/signed; boundary="=-=-=";
\r
33 micalg=pgp-sha1; protocol="application/pgp-signature"
\r
34 X-BeenThere: notmuch@notmuchmail.org
\r
35 X-Mailman-Version: 2.1.13
\r
37 List-Id: "Use and development of the notmuch mail system."
\r
38 <notmuch.notmuchmail.org>
\r
39 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
40 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
41 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
42 List-Post: <mailto:notmuch@notmuchmail.org>
\r
43 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
44 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
45 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
46 X-List-Received-Date: Mon, 08 Nov 2010 17:20:05 -0000
\r
49 Content-Transfer-Encoding: quoted-printable
\r
51 On Thu, 4 Nov 2010 20:49:35 -0700, Michael Forney <mforney@mforney.org> wr=
\r
53 > When decoded_value, header_sofar, and header are unused, they should
\r
56 Thanks for the cleanups here. Just looking over the patch it's clear
\r
57 that I let some code into message-file.c without coercing the style into
\r
58 what I would really prefer to see, (should use talloc more, should move
\r
59 away from overly-abbreviated identifiers such as "hdrsofar", and
\r
60 shouldn't have ambiguously named identifiers such as "header_sofar" and
\r
63 > + free(decoded_value);
\r
64 > + free(header_sofar);
\r
65 > g_hash_table_insert (message->headers, header, combined_header);
\r
68 > if (header_sofar =3D=3D NULL) {
\r
69 > /* Only insert if we don't have a value for this header, yet. */
\r
70 > g_hash_table_insert (message->headers, header, decoded_value);
\r
73 > + free(decoded_value);
\r
75 But I didn't push the change yet. The above do look like memory leak
\r
76 fixes as described in the commit message.
\r
78 > if (match && !is_received)
\r
79 > - return decoded_value;
\r
80 > + return header_sofar =3D=3D NULL ? decoded_value : header_sofar;
\r
83 But this part looks like an independent bug fix that needs its own
\r
84 description, (and perhaps a test case?). Could you please split the
\r
92 carl.d.worth@intel.com
\r
95 Content-Type: application/pgp-signature
\r
97 -----BEGIN PGP SIGNATURE-----
\r
98 Version: GnuPG v1.4.10 (GNU/Linux)
\r
100 iD8DBQFM2DE16JDdNq8qSWgRAtAQAJ9nhgK2kH9mZ0ZAhgbrRd+hMwnx7gCghI/z
\r
101 ia83IEyQ7E5LCEtSdfD4kyo=
\r
103 -----END PGP SIGNATURE-----
\r