From: Rocco Rutte Date: Thu, 6 Jul 2006 17:05:47 +0000 (+0000) Subject: Fix a small memory leak when updating a score pattern. X-Git-Tag: mutt-1-5-12-rel~26 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d733e66e8d8ead1036f461a09c066c7096394f6b;p=mutt Fix a small memory leak when updating a score pattern. --- 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 == '=') {