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 038FE431FC0; Fri, 27 Nov 2009 05:01:55 -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 2xJKwtC7VROf; Fri, 27 Nov 2009 05:01:54 -0800 (PST) Received: from cworth.org (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 0A8B0431FAE; Fri, 27 Nov 2009 05:01:53 -0800 (PST) From: Carl Worth To: djcb@djcbsoftware.nl, "notmuch\@notmuchmail org" In-Reply-To: <873a4480l1.wl%djcb@djcbsoftware.nl> References: <873a4480l1.wl%djcb@djcbsoftware.nl> Date: Fri, 27 Nov 2009 05:01:40 -0800 Message-ID: <87fx80qfyj.fsf@yoom.home.cworth.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [notmuch] [PATCH] notmuch-count: make sure all created items are freed, even in error paths 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, 27 Nov 2009 13:01:55 -0000 On Tue, 24 Nov 2009 16:22:02 +0200, Dirk-Jan C. Binnema wrote: > > Another minor patch, fixing a couple of resource leaks in error paths. Thanks, Dirk-Jan, but we don't actually need this kind of care in some cases, because these aren't leaks in a permanent sense since they are talloc-based. Instead these "leaks" simply mean that on the error paths these objects will live slightly longer than normal, until the caller frees the talloc context. And I'm perfectly happy to have slightly longer-lived objects in the error paths, (while still guaranteeing leak-free behavior in all cases). And I definitely like the easier-to-read-and-verify code that comes with the early return values. Now, we do have to be careful if there are side effects from having an object live longer, (such as holding a database write lock or something). So if there's a fix for something like that in an error path, then yes, we'll definitely want that. -Carl