summaryrefslogtreecommitdiffstats
path: root/mh.c
diff options
context:
space:
mode:
authorKevin McCarthy <kevin@8t8.us>2016-08-05 13:43:00 -0700
committerKevin McCarthy <kevin@8t8.us>2016-08-05 13:43:00 -0700
commit2f6cdf20a7aab5239780df34eaa62383bd104f7e (patch)
treee71dc1c61a674c825d9a869809887fed9185e008 /mh.c
parent800a08cb304ab127b7ae435dd01660f31f73b196 (diff)
Fix memleak in mh_read_dir() when sequence parsing fails.
Diffstat (limited to 'mh.c')
-rw-r--r--mh.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/mh.c b/mh.c
index f7ce25fc..371656af 100644
--- a/mh.c
+++ b/mh.c
@@ -1260,7 +1260,10 @@ static int mh_read_dir (CONTEXT * ctx, const char *subdir)
if (ctx->magic == MUTT_MH)
{
if (mh_read_sequences (&mhs, ctx->path) < 0)
+ {
+ maildir_free_maildir (&md);
return -1;
+ }
mh_update_maildir (md, &mhs);
mhs_free_sequences (&mhs);
}