[PATCH 1/2] cli: S/MIME verification/decryption support
[notmuch-archives.git] / c5 / 43131dfa229c2316842567fd774be6fe989750
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 22D3D431FBC\r
6         for <notmuch@notmuchmail.org>; Tue,  7 Feb 2012 02:06: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 fvnv3FprJ+sG for <notmuch@notmuchmail.org>;\r
18         Tue,  7 Feb 2012 02:06:42 -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 82DBF431FB6 for <notmuch@notmuchmail.org>; Tue,  7 Feb 2012 02:06:42 -0800\r
23  (PST)\r
24 X-Hash:\r
25  S|436efe1a3ed5ebbf742d3717a4d2312265f22a30|8113652595f775174c43145e8c7f9b33\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=1328609200; x=1329214000; l=1314; bh=LudzVUYZyVaiDSVr5V+5o//Y\r
32         wOA=; b=Jin60snVggEG+41xMAoov564/tSgXxNwv/sS1050cepE3kKP5H3Sl67Q\r
33         d25cFPrjlLbnMFVzy4TEovmYJjzVYxzYqC/lRaS8NHrJTNtRF5aZqnuKgVZHovKO\r
34         5EeHpu1UFDGkwzkUznwKMdn98JlSK735XuK/J9IqK6wYNX6o2kA=\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=kcGAKoT+RRkv/BxmFJ\r
37         zIsLWIoL/RfiZbZ/Ch/jwT+eOwbzhg1p2BxELBERpcDUxrCH7E93F9JaVrS/UOE5\r
38         ZTZGb9L7jvzMS+XAk5glhorTLnVO4rDqLoMXC0MTZMdfHo4hpI2QGXwc2ZwRhG9q\r
39         oEsnZxY40KHheXWGUaRniKfFY=\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:q17A6831075843 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 q17A6831075843\r
51         (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO);\r
52         Tue, 7 Feb 2012 05:06:22 -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: Tue,  7 Feb 2012 05:05:03 -0500\r
58 Message-Id: <1328609103-7870-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 10:06:43 -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 v3: I'm still learning the house style. Thanks Dmitry.\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..8dbebb3 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