Re: [PATCH] Free the results of scandir()
authorDavid Bremner <david@tethera.net>
Wed, 15 Feb 2012 03:47:56 +0000 (23:47 +2000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:44:29 +0000 (09:44 -0800)
43/a8b5a3c7895ca99340e592618d9a2619c4c606 [new file with mode: 0644]

diff --git a/43/a8b5a3c7895ca99340e592618d9a2619c4c606 b/43/a8b5a3c7895ca99340e592618d9a2619c4c606
new file mode 100644 (file)
index 0000000..f5e231d
--- /dev/null
@@ -0,0 +1,67 @@
+Return-Path: <bremner@unb.ca>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 9A394431FBD\r
+       for <notmuch@notmuchmail.org>; Tue, 14 Feb 2012 19:48:13 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -2.3\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id IJ7AQCgWzmlr for <notmuch@notmuchmail.org>;\r
+       Tue, 14 Feb 2012 19:48:13 -0800 (PST)\r
+Received: from tempo.its.unb.ca (tempo.its.unb.ca [131.202.1.21])\r
+       (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id E9951431FBC\r
+       for <notmuch@notmuchmail.org>; Tue, 14 Feb 2012 19:48:12 -0800 (PST)\r
+Received: from zancas.localnet\r
+       (fctnnbsc30w-142166230117.dhcp-dynamic.FibreOp.nb.bellaliant.net\r
+       [142.166.230.117]) (authenticated bits=0)\r
+       by tempo.its.unb.ca (8.13.8/8.13.8) with ESMTP id q1F3lvu2009408\r
+       (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO);\r
+       Tue, 14 Feb 2012 23:47:57 -0400\r
+Received: from bremner by zancas.localnet with local (Exim 4.77)\r
+       (envelope-from <bremner@unb.ca>)\r
+       id 1RxVqW-0003Bd-SV; Tue, 14 Feb 2012 23:47:56 -0400\r
+From: David Bremner <david@tethera.net>\r
+To: Ethan Glasser-Camp <glasse@cs.rpi.edu>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH] Free the results of scandir()\r
+In-Reply-To: <1328609103-7870-1-git-send-email-glasse@cs.rpi.edu>\r
+References: <1328609103-7870-1-git-send-email-glasse@cs.rpi.edu>\r
+User-Agent: Notmuch/0.11.1+188~ga5674c2 (http://notmuchmail.org) Emacs/23.3.1\r
+       (x86_64-pc-linux-gnu)\r
+Date: Tue, 14 Feb 2012 23:47:56 -0400\r
+Message-ID: <871upw3ggj.fsf@zancas.localnet>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+Cc: Ethan Glasser-Camp <ethan@betacantrips.com>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Wed, 15 Feb 2012 03:48:13 -0000\r
+\r
+On Tue,  7 Feb 2012 05:05:03 -0500, Ethan Glasser-Camp <glasse@cs.rpi.edu> wrote:\r
+> From: Ethan Glasser-Camp <ethan@betacantrips.com>\r
+> \r
+> scandir() returns "strings allocated via malloc(3)" which are then\r
+> "collected in array namelist which is allocated via\r
+> malloc(3)". Currently we just free the array namelist. Instead, free\r
+> all the entries of namelist, and then free namelist.\r
+\r
+pushed, thanks\r
+\r
+d\r