+@@ -238,6 +238,7 @@
+ for (i = 0; !r && i <= mhs.max; i++)
+ if (mhs_check (&mhs, i) & MH_SEQ_UNSEEN)
+ r = 1;
++ mhs_free_sequences (&mhs);
+ return r;
+ }
+
+@@ -1155,7 +1156,7 @@
+
+ if (ctx->magic == M_MH)
+ {
+- if (mh_read_sequences (&mhs, ctx->path) >= 0)
++ if (mh_read_sequences (&mhs, ctx->path) < 0)
+ return -1;
+ mh_update_maildir (md, &mhs);
+ mhs_free_sequences (&mhs);