From: Thomas Roessler Date: Wed, 12 Nov 2003 11:40:27 +0000 (+0000) Subject: Fix dangling pointer problems in threading code. Noted and tracked X-Git-Tag: mutt-1-5-6-rel~77 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7d0395fbe0a548451ffbe86ed9ff15f26e3900aa;p=mutt Fix dangling pointer problems in threading code. Noted and tracked down by q4xk3j002@sneakemail.com who also provided the initial fix. --- diff --git a/mh.c b/mh.c index f3f9fae1..56265b5f 100644 --- a/mh.c +++ b/mh.c @@ -1401,7 +1401,9 @@ static void maildir_update_tables (CONTEXT *ctx, int *index_hint) if (ctx->hdrs[i]->active) ctx->hdrs[i]->index = j++; } + mx_update_tables (ctx, 0); + mutt_clear_threads (ctx); } static void maildir_update_flags (CONTEXT *ctx, HEADER *o, HEADER *n) diff --git a/sort.c b/sort.c index 1ef97e5b..cec5b3c7 100644 --- a/sort.c +++ b/sort.c @@ -194,7 +194,7 @@ void mutt_sort_headers (CONTEXT *ctx, int init) * in that routine, so we must make sure to zero the vcount member. */ ctx->vcount = 0; - ctx->tree = 0; + mutt_clear_threads (ctx); return; /* nothing to do! */ }