On Tue, Aug 30, 2016 at 05:53:55PM -0700, [email protected] wrote:
> Uncollapse threads when new mail arrives.
> 
> Adds $uncollapse_new: when set, a collapsed thread into which a new
> message arrives will be uncollapsed to reveal the new message.
> 
> diff --git a/curs_main.c b/curs_main.c
> --- a/curs_main.c
> +++ b/curs_main.c
> @@ -402,7 +402,7 @@
>    mutt_sort_headers (ctx, (check == MUTT_REOPENED));
>  
>    /* uncollapse threads with new mail */
> -  if ((Sort & SORT_MASK) == SORT_THREADS)
> +  if (option(OPTUNCOLLAPSENEW) && ((Sort & SORT_MASK) == SORT_THREADS))
>    {
>      if (check == MUTT_REOPENED)
>      {

This is leading to a memory leak of save_new if the option is unset.

Since it's initialzed to NULL, I'd just pull the FREE below the if
statement, but it's also fine to add the option check to the
  if (oldcount && check != MUTT_REOPENED
        && ((Sort & SORT_MASK) == SORT_THREADS))
if statement that allocates it.

-- 
Kevin J. McCarthy
GPG Fingerprint: 8975 A9B3 3AA3 7910 385C  5308 ADEF 7684 8031 6BDA

Attachment: signature.asc
Description: PGP signature

Reply via email to