Re: [PATCH 04/20] util/crypto: _notmuch_message_crypto: tracks message-wide crypto state

Subject: Re: [PATCH 04/20] util/crypto: _notmuch_message_crypto: tracks message-wide crypto state

Date: Thu, 28 Jun 2018 17:15:01 -0400

To: David Bremner, Notmuch Mail

Cc:

From: Daniel Kahn Gillmor


On Fri 2018-06-15 07:16:05 -0300, David Bremner wrote:
> Daniel Kahn Gillmor <dkg@fifthhorseman.net> 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
_______________________________________________
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch

Thread: