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