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: Fri, 15 Jun 2018 07:16:05 -0300

To: Daniel Kahn Gillmor, Notmuch Mail

Cc:

From: David Bremner


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

> +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.

_______________________________________________
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch

Thread: