<<< Date Index >>>     <<< Thread Index >>>

[PATCH] memleak in generic spam detection stuff



Hello together,
while I was debugging the color status patch, I found a little memleak
in the generic spam detection stuff. Patch attached - as usual against
CVS HEAD.

        Thomas
diff -Nru a/init.c b/init.c
--- a/init.c    2004-07-24 12:27:20 +02:00
+++ b/init.c    2004-08-25 21:36:41 +02:00
@@ -639,8 +639,11 @@
       mutt_extract_token (&templ, s, 0);
 
       /* Add to the spam list. */
-      if (add_to_spam_list (&SpamList, buf->data, templ.data, err) != 0)
+      if (add_to_spam_list (&SpamList, buf->data, templ.data, err) != 0) {
+         FREE(&templ.data);
           return -1;
+      }
+      FREE(&templ.data);
     }
 
     /* If not, try to remove from the nospam list. */