]> granicus.if.org Git - mutt/commitdiff
Small hcache-related memory leaks
authorBrendan Cully <brendan@kublai.com>
Thu, 5 Apr 2007 23:42:56 +0000 (16:42 -0700)
committerBrendan Cully <brendan@kublai.com>
Thu, 5 Apr 2007 23:42:56 +0000 (16:42 -0700)
imap/message.c
mh.c

index 50cdeeff2c965e93c9ca4b47c94d82297545308e..7a91b7f24391d1f7e99abba1d715e1ae036e3b89 100644 (file)
@@ -131,6 +131,8 @@ int imap_read_headers (IMAP_DATA* idata, int msgbegin, int msgend)
     if (uid_validity && uidnext && *uid_validity == idata->uid_validity
         && *uidnext > 0)
       evalhc = 1;
+    else
+      FREE (&uidnext);
     FREE (&uid_validity);
   }
   if (evalhc)
diff --git a/mh.c b/mh.c
index 76a79a11223d9fc2b4880e2bc3d271705b24ed45..b4e42c27324502ade698d8345dc88a53b7427a17 100644 (file)
--- a/mh.c
+++ b/mh.c
@@ -700,11 +700,15 @@ static int maildir_parse_entry (CONTEXT * ctx, struct maildir ***last,
   {
 #ifdef USE_HCACHE
     if (hc && (data = mutt_hcache_fetch (hc, fname, strlen)))
+    {
       h = mutt_hcache_restore ((unsigned char *) data, NULL);
+      FREE (&data);
+    }
     else
     {
       h = maildir_parse_message (ctx->magic, buf, is_old, NULL);
-      mutt_hcache_store (hc, fname, h, 0, strlen);
+      if (h)
+        mutt_hcache_store (hc, fname, h, 0, strlen);
     }
 #else
     h = maildir_parse_message (ctx->magic, buf, is_old, NULL);
@@ -1035,7 +1039,7 @@ void maildir_delayed_parsing (CONTEXT * ctx, struct maildir *md,
     } else
       mutt_free_header (&p->h);
 #if USE_HCACHE
-    FREE(&data);
+    FREE (&data);
 #endif
   }
 #if USE_HCACHE