Re: [notmuch] [PATCH 2/2] * free the response data from 'prompt'
authorCarl Worth <cworth@cworth.org>
Fri, 4 Dec 2009 19:18:36 +0000 (11:18 +1600)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:35:50 +0000 (09:35 -0800)
5a/76ea2e0f6ea8ef1647d25a48e02ba14346bd0e [new file with mode: 0644]

diff --git a/5a/76ea2e0f6ea8ef1647d25a48e02ba14346bd0e b/5a/76ea2e0f6ea8ef1647d25a48e02ba14346bd0e
new file mode 100644 (file)
index 0000000..cfce3b5
--- /dev/null
@@ -0,0 +1,75 @@
+Return-Path: <cworth@cworth.org>\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 CFA79431FBD;\r
+       Fri,  4 Dec 2009 11:18:37 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\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 3rudHfjU+-YI; Fri,  4 Dec 2009 11:18:37 -0800 (PST)\r
+Received: from yoom.home.cworth.org (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 00078431FAE;\r
+       Fri,  4 Dec 2009 11:18:36 -0800 (PST)\r
+Received: by yoom.home.cworth.org (Postfix, from userid 1000)\r
+       id A784C2542FB; Fri,  4 Dec 2009 11:18:36 -0800 (PST)\r
+From: Carl Worth <cworth@cworth.org>\r
+To: "Dirk-Jan C. Binnema" <djcb.bulk@gmail.com>, notmuch@notmuchmail.org\r
+In-Reply-To: <1259737885-15103-2-git-send-email-djcb.bulk@gmail.com>\r
+References: <1259737885-15103-1-git-send-email-djcb.bulk@gmail.com>\r
+       <1259737885-15103-2-git-send-email-djcb.bulk@gmail.com>\r
+Date: Fri, 04 Dec 2009 11:18:36 -0800\r
+Message-ID: <873a3qfsz7.fsf@yoom.home.cworth.org>\r
+MIME-Version: 1.0\r
+Content-Type: multipart/signed; boundary="=-=-=";\r
+       micalg=pgp-sha1; protocol="application/pgp-signature"\r
+Subject: Re: [notmuch] [PATCH 2/2] * free the response data from 'prompt'\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.12\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: Fri, 04 Dec 2009 19:18:38 -0000\r
+\r
+--=-=-=\r
+Content-Transfer-Encoding: quoted-printable\r
+\r
+On Wed,  2 Dec 2009 09:11:25 +0200, "Dirk-Jan C. Binnema" <djcb.bulk@gmail.=\r
+com> wrote:\r
+> Free the results of the prompt; this patch does the minimal job for that.\r
+> It may be nice to refactor the function a bit.=20\r
+>=20\r
+> Signed-off-by: Dirk-Jan C. Binnema <djcb.bulk@gmail.com>\r
+\r
+Hi there,\r
+\r
+I pushed the first leak fix from this series, but the below is doing a\r
+little more work than necessary.\r
+\r
+The getline function is happy to accept a malloc'ed pointer and return\r
+it again if it's large enough, (or otherwise realloc it and return the\r
+result).\r
+\r
+So we don't need to free response between each call to prompt, but just\r
+after the last one.\r
+\r
+=2DCarl\r
+\r
+--=-=-=\r
+Content-Type: application/pgp-signature\r
+\r
+-----BEGIN PGP SIGNATURE-----\r
+Version: GnuPG v1.4.10 (GNU/Linux)\r
+\r
+iD8DBQFLGWCM6JDdNq8qSWgRAoaZAJ9YZbpPSD3cKgaDY01R1etohqC7jQCaAsEx\r
+WaxR8cRlndvYdHewqPiLs1k=\r
+=zLTo\r
+-----END PGP SIGNATURE-----\r
+--=-=-=--\r