From d733e66e8d8ead1036f461a09c066c7096394f6b Mon Sep 17 00:00:00 2001 From: Rocco Rutte Date: Thu, 6 Jul 2006 17:05:47 +0000 Subject: [PATCH] Fix a small memory leak when updating a score pattern. --- score.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/score.c b/score.c index 208c37c3..79ce762f 100644 --- 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 == '=') { -- 2.50.1