]> granicus.if.org Git - neomutt/commitdiff
Fix a small memory leak when updating a score pattern.
authorRocco Rutte <pdmef@gmx.net>
Thu, 6 Jul 2006 17:05:47 +0000 (17:05 +0000)
committerRocco Rutte <pdmef@gmx.net>
Thu, 6 Jul 2006 17:05:47 +0000 (17:05 +0000)
score.c

diff --git a/score.c b/score.c
index 208c37c3f99612d2531c9076d1c24b0d4dd00066..79ce762f6ea75c849f6f2e348a26ac5a2f0755dc 100644 (file)
--- a/score.c
+++ b/score.c
@@ -104,7 +104,12 @@ int mutt_parse_score (BUFFER *buf, BUFFER *s, unsigned long data, BUFFER *err)
       Score = ptr;
     ptr->pat = pat;
     ptr->str = pattern;
-  }
+  } else
+    /* 'buf' arg was cleared and 'pattern' holds the only reference;
+     * as here 'ptr' != NULL -> update the value only in which case
+     * ptr->str already has the string, so pattern should be freed.
+     */
+    FREE (&pattern);
   pc = buf->data;
   if (*pc == '=')
   {