Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / 14 / 632972f681aaaf0e13d54a4753218d07fac754
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 E5820431FAF\r
6         for <notmuch@notmuchmail.org>; Mon,  6 Feb 2012 22:50:43 -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 aJHR4KKIUsKc for <notmuch@notmuchmail.org>;\r
18         Mon,  6 Feb 2012 22:50:43 -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 3E91F431FAE for <notmuch@notmuchmail.org>; Mon,  6 Feb 2012 22:50:43 -0800\r
23  (PST)\r
24 X-Hash:\r
25  S|40e4c517ca0459386989b82fa84cfcb00c964d05|ab058044c63300b1ad8418f36616e81f\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=1328597441; x=1329202241; l=1324; bh=RQpuYYAQVZCaa6oTlvwssFG3\r
32         WrI=; b=P11A6fwMJ1pOKwgqk1xINRibAzSKZFUrxxUDmO3pOZMcyYfeqTwJmLaJ\r
33         oXRWkiO55uF7vhTyh6eqd5MpmonyhmApUjYbCo+WFEXfP8BnZS8xsm+pwqXM0wpR\r
34         SiFRCtdg+UIQERbwtX++EpdHwr979EKLAvkWGs9RmZlWWRmvtQw=\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=QXz70/Sq93rAKju6LX\r
37         GjRH2Uq9PJek+G3djd1xqIsHL6aPwBzWSbVm9lSyv17rjyPmf7tKowyBoCRGN+BK\r
38         96RNLpasN7TPbRGF4lYDudkUU7jfChzP7QAUAQjxdGVm6fvuPwebDOYJBaqLtpmT\r
39         18QvSLtg9bKmINgdQIO/7S5fk=\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:q176oJxj073383 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 q176oJxj073383\r
51         (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO);\r
52         Tue, 7 Feb 2012 01:50:34 -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 v2] Free the results of scandir()\r
57 Date: Tue,  7 Feb 2012 01:50:05 -0500\r
58 Message-Id: <1328597405-6437-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: Tue, 07 Feb 2012 06:50:44 -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 Fixes the other use of scandir in count_files. Thanks, Jani.\r
88 \r
89  notmuch-new.c |   16 ++++++++++------\r
90  1 files changed, 10 insertions(+), 6 deletions(-)\r
91 \r
92 diff --git a/notmuch-new.c b/notmuch-new.c\r
93 index a569a54..e62560b 100644\r
94 --- a/notmuch-new.c\r
95 +++ b/notmuch-new.c\r
96 @@ -559,12 +559,14 @@ add_files_recursive (notmuch_database_t *notmuch,\r
97    DONE:\r
98      if (next)\r
99         talloc_free (next);\r
100 -    if (entry)\r
101 -       free (entry);\r
102      if (dir)\r
103         closedir (dir);\r
104 -    if (fs_entries)\r
105 +    if (fs_entries){\r
106 +       for (i = 0; i < num_fs_entries; i++){\r
107 +           free (fs_entries[i]);\r
108 +       }\r
109         free (fs_entries);\r
110 +    }\r
111      if (db_subdirs)\r
112         notmuch_filenames_destroy (db_subdirs);\r
113      if (db_files)\r
114 @@ -704,10 +706,12 @@ count_files (const char *path, int *count)\r
115      }\r
116  \r
117    DONE:\r
118 -    if (entry)\r
119 -       free (entry);\r
120 -    if (fs_entries)\r
121 +    if (fs_entries){\r
122 +       for (i = 0; i < num_fs_entries; i++){\r
123 +           free (fs_entries[i]);\r
124 +       }\r
125          free (fs_entries);\r
126 +    }\r
127  }\r
128  \r
129  static void\r
130 -- \r
131 1.7.5.4\r
132 \r