Re: notmuch.el: controlling what does and doesn't get expanded in searches
[notmuch-archives.git] / 7d / 4231ffd3bad93da7451b2f562b7b7e882d1768
1 Return-Path: <glasse@cs.rpi.edu>\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 89659431FAF\r
6         for <notmuch@notmuchmail.org>; Mon,  6 Feb 2012 14:03:41 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.54\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.54 tagged_above=-999 required=5\r
12         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
13         RCVD_IN_BL_SPAMCOP_NET=1.246, RCVD_IN_DNSWL_MED=-2.3,\r
14         RCVD_IN_SORBS_WEB=0.614] autolearn=disabled\r
15 Received: from olra.theworths.org ([127.0.0.1])\r
16         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
17         with ESMTP id yzxeCoz-IYrM for <notmuch@notmuchmail.org>;\r
18         Mon,  6 Feb 2012 14:03:34 -0800 (PST)\r
19 Received: from cliffclavin.cs.rpi.edu (cliffclavin.cs.rpi.edu\r
20  [128.113.126.25])      (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
21         (No client certificate requested)       by olra.theworths.org (Postfix) with ESMTPS\r
22  id 6301A431FAE for <notmuch@notmuchmail.org>; Mon,  6 Feb 2012 14:03:34 -0800\r
23  (PST)\r
24 X-Hash:\r
25  S|87554d9768bab8a4ccc4379bb721ab9fd9e7450b|8e3fb853444f45e635c0d8a16b0e28ee\r
26 X-Countries: Cameroon, United States\r
27 X-SMTP-From: accepted <glasse@cs.rpi.edu> [195.24.209.22] [195.24.209.22]\r
28         (localhost) {Cameroon}\r
29 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=cs.rpi.edu; h=from\r
30         :to:cc:subject:date:message-id; s=default; i=glasse@cs.rpi.edu;\r
31         t=1328565812; x=1329170612; l=1091; bh=uSo3tBW0aK3WJQQVKhpr4qpF\r
32         VBY=; b=Ejx77AwPL7XW4mkdIl6aU+Ro8yziNpjbIe1DExZC9biSASWXqgZFjgAI\r
33         WTOhHnqdw65rxkAXdiWMdpu+uW/4aJaBdW+Fw1bsxwUbN917/cLBvsqtGyDOES2M\r
34         9iIOrjq1bSMZdbtU1rclfJZW9GUTDsmELC3hA1lKjWDnON0pz1E=\r
35 DomainKey-Signature: a=rsa-sha1; c=nofws; d=cs.rpi.edu; h=from:to:cc\r
36         :subject:date:message-id; q=dns; s=default; b=XRgRNfMyh1see/P6b+\r
37         jtPi3vcxVfvF6dE/BysPB0fGyLA+XOF66A0oTdg82H0YtdWJhC1tQmS0eDDfsJxr\r
38         1rpj3Ije/+80PLF1Vis0RuRQ7KjpEEk6c1EtjjeofZd2JTPf27MCkdc2T8J8tIr/\r
39         XEJvfcrQyBQTmgUL5WxHhzzXc=\r
40 X-Spam-Info: -2.7; ALL_TRUSTED,AWL,BAYES_00\r
41 X-Spam-Scanned-By: cliffclavin.cs.rpi.edu using SpamAssassin 3.2.5 (hard limit\r
42         15)\r
43 Authentication-Results: cliffclavin.cs.rpi.edu;\r
44         DKIM=neutral (none) header.from=glasse@cs.rpi.edu;\r
45         SPF=neutral (mfrom;\r
46         Mechanism '?all' matched) smtp.mail=glasse@cs.rpi.edu\r
47 X-Auth-Passed: cliffclavin.cs.rpi.edu:q16M38mA069463 Auth:glasse\r
48 X-Virus-Scanned-By: cliffclavin.cs.rpi.edu\r
49 Received: from localhost ([195.24.209.22]) (authenticated bits=0)\r
50         by cliffclavin.cs.rpi.edu (8.14.3/8.14.3) with ESMTP id q16M38mA069463\r
51         (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO);\r
52         Mon, 6 Feb 2012 17:03:24 -0500 (EST)\r
53         (envelope-from glasse@cs.rpi.edu)\r
54 From: Ethan Glasser-Camp <glasse@cs.rpi.edu>\r
55 To: notmuch@notmuchmail.org\r
56 Subject: [PATCH] Free the results of scandir()\r
57 Date: Mon,  6 Feb 2012 17:02:49 -0500\r
58 Message-Id: <1328565769-29414-1-git-send-email-glasse@cs.rpi.edu>\r
59 X-Mailer: git-send-email 1.7.5.4\r
60 X-Scanned-By: MIMEDefang 2.67 on 128.113.126.25\r
61 Cc: Ethan Glasser-Camp <ethan@betacantrips.com>\r
62 X-BeenThere: notmuch@notmuchmail.org\r
63 X-Mailman-Version: 2.1.13\r
64 Precedence: list\r
65 List-Id: "Use and development of the notmuch mail system."\r
66         <notmuch.notmuchmail.org>\r
67 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
68         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
69 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
70 List-Post: <mailto:notmuch@notmuchmail.org>\r
71 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
72 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
73         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
74 X-List-Received-Date: Mon, 06 Feb 2012 22:03:41 -0000\r
75 \r
76 From: Ethan Glasser-Camp <ethan@betacantrips.com>\r
77 \r
78 scandir() returns "strings allocated via malloc(3)" which are then\r
79 "collected in array namelist which is allocated via\r
80 malloc(3)". Currently we just free the array namelist. Instead, free\r
81 all the entries of namelist, and then free namelist.\r
82 \r
83 entry only points to elements of namelist, so we don't free it\r
84 separately.\r
85 ---\r
86 \r
87 This should fix a minor memory leak in notmuch-new. Please confirm I'm\r
88 reading the manpage correctly ;)\r
89 \r
90  notmuch-new.c |    8 +++++---\r
91  1 files changed, 5 insertions(+), 3 deletions(-)\r
92 \r
93 diff --git a/notmuch-new.c b/notmuch-new.c\r
94 index a569a54..c536873 100644\r
95 --- a/notmuch-new.c\r
96 +++ b/notmuch-new.c\r
97 @@ -559,12 +559,14 @@ add_files_recursive (notmuch_database_t *notmuch,\r
98    DONE:\r
99      if (next)\r
100         talloc_free (next);\r
101 -    if (entry)\r
102 -       free (entry);\r
103      if (dir)\r
104         closedir (dir);\r
105 -    if (fs_entries)\r
106 +    if (fs_entries){\r
107 +       for (i = 0; i < num_fs_entries; i++){\r
108 +           free (fs_entries[i]);\r
109 +       }\r
110         free (fs_entries);\r
111 +    }\r
112      if (db_subdirs)\r
113         notmuch_filenames_destroy (db_subdirs);\r
114      if (db_files)\r
115 -- \r
116 1.7.5.4\r
117 \r