From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 73A786DE0202 for ; Thu, 28 Jun 2018 17:06:06 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.004 X-Spam-Level: X-Spam-Status: No, score=0.004 tagged_above=-999 required=5 tests=[AWL=-0.006, RCVD_IN_DNSWL_NONE=-0.0001, T_SPF_PERMERROR=0.01] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ATYqP_wW_VAB for ; Thu, 28 Jun 2018 17:06:05 -0700 (PDT) Received: from che.mayfirst.org (che.mayfirst.org [162.247.75.118]) by arlo.cworth.org (Postfix) with ESMTPS id 491386DE01F2 for ; Thu, 28 Jun 2018 17:06:05 -0700 (PDT) Received: from fifthhorseman.net (ool-6c3a0662.static.optonline.net [108.58.6.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by che.mayfirst.org (Postfix) with ESMTPSA id 410CDF99A; Thu, 28 Jun 2018 20:06:02 -0400 (EDT) Received: by fifthhorseman.net (Postfix, from userid 1000) id 517FF203FC; Thu, 28 Jun 2018 17:15:01 -0400 (EDT) From: Daniel Kahn Gillmor To: David Bremner , Notmuch Mail Subject: Re: [PATCH 04/20] util/crypto: _notmuch_message_crypto: tracks message-wide crypto state In-Reply-To: <87d0wsjqxm.fsf@tethera.net> References: <20180511055544.13676-1-dkg@fifthhorseman.net> <20180511055544.13676-5-dkg@fifthhorseman.net> <87d0wsjqxm.fsf@tethera.net> Date: Thu, 28 Jun 2018 17:15:01 -0400 Message-ID: <87k1qipq96.fsf@fifthhorseman.net> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.26 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, 29 Jun 2018 00:06:06 -0000 On Fri 2018-06-15 07:16:05 -0300, David Bremner wrote: > Daniel Kahn Gillmor writes: > >> +notmuch_status_t >> +_notmuch_message_crypto_set_sig_list (_notmuch_message_crypto_t *msg_crypto, GMimeSignatureList *sigs) >> +{ > > It's a bit confusing that nothing in this API/patch seems to use the > sig_list stored by this function i've updated the commit message to explain that we will use it later :) >> +void >> +_notmuch_message_crypto_cleanup (_notmuch_message_crypto_t *msg_crypto) >> +{ >> + if (!msg_crypto) >> + return; >> + if (msg_crypto->sig_list) >> + g_object_unref (msg_crypto->sig_list); >> +} > > It _looks_ like you're planning on manually calling > _notmuch_message_crypto_cleanup. In order to allow for hierarchical > de-allocation (i.e. non-explicit de-allocation, we need to call > talloc_set_destructor. There's a few examples in the the existing code. ah, good call. in the revised version, that should be taken care of. hopefully i even did it right :) thanks for the heads-up! --dkg