From fabdf4e38885ad280e5511bbe4a8ee6a25d2df60 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Mon, 29 Dec 2008 11:49:26 +0000 Subject: ** Fixes bug #565857 2008-12-29 Matthew Barnes ** Fixes bug #565857 * mail/e-searching-tokenizer.c (searcher_next_token): The HTMLTokenizer now expects a newly-allocated string from its next_token() method, so duplicate the returned string. This fixes a memory leak whereby previously, some implementations of next_token() did return a newly-allocated string, some did not. Those that did leaked those strings. svn path=/trunk/; revision=36945 --- mail/ChangeLog | 11 +++++++++++ mail/e-searching-tokenizer.c | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/mail/ChangeLog b/mail/ChangeLog index 2050d53983..fe9ebb2b84 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,14 @@ +2008-12-29 Matthew Barnes + + ** Fixes bug #565857 + + * e-searching-tokenizer.c (searcher_next_token): + The HTMLTokenizer now expects a newly-allocated string from its + next_token() method, so duplicate the returned string. This fixes + a memory leak whereby previously, some implementations of next_token() + did return a newly-allocated string, some did not. Those that did + leaked those strings. + 2008-12-22 Sankar P ** Part of fix for bug #559153 diff --git a/mail/e-searching-tokenizer.c b/mail/e-searching-tokenizer.c index 88aca1eca8..172a126c92 100644 --- a/mail/e-searching-tokenizer.c +++ b/mail/e-searching-tokenizer.c @@ -811,7 +811,7 @@ searcher_next_token(struct _searcher *s) s->current = token = (struct _token *)e_dlist_remhead(&s->output); - return token?token->tok:NULL; + return token ? g_strdup (token->tok) : NULL; } static char * -- cgit v1.2.3