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 53DDB431FBC for ; Sat, 21 Nov 2009 14:17:07 -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 izf4Gi5Uoi2C for ; Sat, 21 Nov 2009 14:17:06 -0800 (PST) Received: from sirius.lasnet.de (sirius.lasnet.de [78.47.116.19]) by olra.theworths.org (Postfix) with ESMTP id 72804431FAE for ; Sat, 21 Nov 2009 14:17:06 -0800 (PST) Received: from p5b034af6.dip.t-dialin.net ([91.3.74.246] helo=excalibur) by sirius.lasnet.de with esmtpsa (Cipher TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.63 #1) id 1NByGN-0006tB-2j by authid with cram_md5 for ; Sat, 21 Nov 2009 23:17:05 +0100 Received: from stefan by excalibur with local (Exim 4.69) (envelope-from ) id 1NByGM-0000A6-AB for notmuch@notmuchmail.org; Sat, 21 Nov 2009 23:17:02 +0100 Date: Sat, 21 Nov 2009 23:17:02 +0100 From: Stefan Schmidt To: notmuch@notmuchmail.org Message-ID: <20091121221702.GG24602@excalibur.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Mailer: Mutt http://www.mutt.org/ X-KeyID: 0xDDF51665 X-Website: http://www.datenfreihafen.org/ User-Agent: Mutt/1.5.20 (2009-06-14) Subject: [notmuch] [PATCH] notmuch-config: Fix memleaks. 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: Sat, 21 Nov 2009 22:17:07 -0000 >From 4bb598e6e0fa32d5184be54cb5c66fe364eba374 Mon Sep 17 00:00:00 2001 From: Holger Freyther Date: Sat, 21 Nov 2009 22:45:23 +0100 Subject: [PATCH] notmuch-config: Fix memleaks. While talloc is great we need to free the g_error by hand. Tested-by: Stefan Schmidt Signed-off-by: Holger Freyther --- notmuch-config.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/notmuch-config.c b/notmuch-config.c index 7252a19..aaa0372 100644 --- a/notmuch-config.c +++ b/notmuch-config.c @@ -207,9 +207,11 @@ notmuch_config_open (void *ctx, fprintf (stderr, "Error reading configuration file %s: %s\n", config->filename, error->message); talloc_free (config); + g_error_free (error); return NULL; } + g_error_free (error); is_new = 1; } @@ -308,6 +310,7 @@ notmuch_config_save (notmuch_config_t *config) if (! g_file_set_contents (config->filename, data, length, &error)) { fprintf (stderr, "Error saving configuration to %s: %s\n", config->filename, error->message); + g_error_free (error); return 1; } -- 1.6.5.3