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 408986DE0C3F for ; Fri, 15 Jun 2018 03:16:11 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.001 X-Spam-Level: X-Spam-Status: No, score=-0.001 tagged_above=-999 required=5 tests=[AWL=0.010, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-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 MFdDy2sePKU7 for ; Fri, 15 Jun 2018 03:16:10 -0700 (PDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTPS id 09BEE6DE0C3D for ; Fri, 15 Jun 2018 03:16:09 -0700 (PDT) Received: from remotemail by fethera.tethera.net with local (Exim 4.89) (envelope-from ) id 1fTlm2-0006IX-Qc; Fri, 15 Jun 2018 06:16:06 -0400 Received: (nullmailer pid 2961 invoked by uid 1000); Fri, 15 Jun 2018 10:16:05 -0000 From: David Bremner To: Daniel Kahn Gillmor , Notmuch Mail Subject: Re: [PATCH 04/20] util/crypto: _notmuch_message_crypto: tracks message-wide crypto state In-Reply-To: <20180511055544.13676-5-dkg@fifthhorseman.net> References: <20180511055544.13676-1-dkg@fifthhorseman.net> <20180511055544.13676-5-dkg@fifthhorseman.net> Date: Fri, 15 Jun 2018 07:16:05 -0300 Message-ID: <87d0wsjqxm.fsf@tethera.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, 15 Jun 2018 10:16:11 -0000 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 > +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.