Re: [PATCH] open: avoid leaking index_as_text regex objects

Subject: Re: [PATCH] open: avoid leaking index_as_text regex objects

Date: Sun, 12 Oct 2025 11:48:28 -0300

To: Anton Khirnov, notmuch@notmuchmail.org

Cc:

From: David Bremner


Anton Khirnov <anton@khirnov.net> writes:

>  
>  	regexv = talloc_realloc (notmuch, regexv, regex_t, nregex + 1);
> +	if (nregex == 0)
> +	    talloc_set_destructor (regexv, _index_as_text_free);
> +

I finally undestood the logic here, but it is bit surprising when just
looking at this part of the code, so please explain in a comment. A more
fulsome commit message would also be welcome.
_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: