]> granicus.if.org Git - neomutt/commitdiff
Fix dangling pointer problems in threading code. Noted and tracked
authorThomas Roessler <roessler@does-not-exist.org>
Wed, 12 Nov 2003 11:40:27 +0000 (11:40 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Wed, 12 Nov 2003 11:40:27 +0000 (11:40 +0000)
down by q4xk3j002@sneakemail.com who also provided the initial fix.

mh.c
sort.c

diff --git a/mh.c b/mh.c
index f3f9fae1b0544f106aac0b48408871f7935dc8dc..56265b5fb5efe72dd3c75ccfcaef1d98436e4f83 100644 (file)
--- 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 1ef97e5b9467623ecc45da4ecaa2c25fa9405ded..cec5b3c7cafb6edda525e7df249dea71fa87852d 100644 (file)
--- 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! */
   }