From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id yEP0BIiIQ2DJegAA0tVLHw (envelope-from ) for ; Sat, 06 Mar 2021 13:50:00 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id IHyfAIiIQ2CCIwAAbx9fmQ (envelope-from ) for ; Sat, 06 Mar 2021 13:50:00 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [144.217.243.247]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id ACB959FFA for ; Sat, 6 Mar 2021 14:49:59 +0100 (CET) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 596A52756A; Sat, 6 Mar 2021 08:49:44 -0500 (EST) Received: from fethera.tethera.net (fethera.tethera.net [IPv6:2607:5300:60:c5::1]) by mail.notmuchmail.org (Postfix) with ESMTP id 90ACE27079 for ; Sat, 6 Mar 2021 08:49:40 -0500 (EST) Received: by fethera.tethera.net (Postfix, from userid 1001) id D39065FAA5; Sat, 6 Mar 2021 08:49:39 -0500 (EST) Received: (nullmailer pid 491409 invoked by uid 1000); Sat, 06 Mar 2021 13:49:37 -0000 From: David Bremner To: notmuch@notmuchmail.org Cc: David Bremner Subject: [PATCH 4/4] lib/open: free GKeyFile Date: Sat, 6 Mar 2021 09:49:34 -0400 Message-Id: <20210306134934.491249-5-david@tethera.net> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210306134934.491249-1-david@tethera.net> References: <20210306134934.491249-1-david@tethera.net> MIME-Version: 1.0 Message-ID-Hash: MAZN5QK2K5C6QV2YR4A72TOB5D6UNOC5 X-Message-ID-Hash: MAZN5QK2K5C6QV2YR4A72TOB5D6UNOC5 X-MailFrom: bremner@tethera.net X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.1 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1615038599; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=tJL9OSZ35QzmGgK1kepVMsjNODAiMuNe88doiVNkqUk=; b=mbUAJ5Sv85zk9qbVonBCQ2j9SC8US9FtX/tF+IFekLQAEysbAvRq4RfzDEvSoDkgC6lMhG Z33TK3mD8p8o1J91cAcLYLn5D4bkVQ+JI+oudNL2rfE3ZQtyAxjamOAmFpf9Ca3YfVvSuo AFm8B1SnEbt0f9sPuc5gHgiXSHA5R5b89EOLq0VWXV3wD3yB4sd1HTrFRv3xnA7eefksfV lWROuRxb/p5KBj0tEnyuNG6VvAo/otsx7ZL+mRkMVNY8nhvq0rzybuiPJ7XT9CHZAs58it xCchaViB4SwK9CZ6/2KR88stkJ7oqPgPSk8Dg/nFnbyTT95Uwbw49FehfhX2LA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1615038599; a=rsa-sha256; cv=none; b=qYCF4rqXFkwPnr081Q3XkNDEOwEsgFEzDyCVHAL/ZEDtotrtV3wozz7UMowyi/nSlcP1El fVQQ2W89CxwExZ5LInJmDY9aO7jkH4/+TJJbeBfsJ3zziqFDPmTX4LFpQ7ttWb/87nSUs0 Vv5Cq9sxxxCNmbeGtWU9uGzzHrZLLTJ3uRq1mMTc0Q/7RCzhLWNB0TX585UZsKWX+QVExv aGB8jcbygnWpzoGACrtckzcOgvEGMTV93NWXwRxdmrEdW7wZSAaA5ca5FQ8bhSDZrNBQRA 71hzMZDB56mNpyKURxV3DaETHjL24Sws5UHIL1zxsIkb4SK3a/34WPbt9tK1zg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 144.217.243.247 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: -1.07 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 144.217.243.247 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: ACB959FFA X-Spam-Score: -1.07 X-Migadu-Scanner: scn0.migadu.com X-TUID: bQ9JGbr6xnMj This fixes a small-to-medium (depending on size of config file) memory leak. --- lib/open.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/open.cc b/lib/open.cc index b424fa0c..a5211746 100644 --- a/lib/open.cc +++ b/lib/open.cc @@ -372,6 +372,9 @@ notmuch_database_open_with_config (const char *database_path, DONE: talloc_free (local); + if (key_file) + g_key_file_free (key_file); + if (message) { if (status_string) *status_string = message; @@ -488,6 +491,9 @@ notmuch_database_create_with_config (const char *database_path, DONE: talloc_free (local); + if (key_file) + g_key_file_free (key_file); + if (message) { if (status_string) *status_string = message; -- 2.30.1