From a2a29549268e8d75d0cc8c0f8de4d0542b1889b2 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Wed, 26 Mar 2014 10:38:34 +0100 Subject: [text-highlight] Fix a possible memory leak The related part of the code could be reached also when the 'syntax' variable had been previously set to a newly allocated string, thus (try to) free it first. --- modules/text-highlight/e-mail-formatter-text-highlight.c | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/text-highlight/e-mail-formatter-text-highlight.c b/modules/text-highlight/e-mail-formatter-text-highlight.c index 4f171ee957..5946615c27 100644 --- a/modules/text-highlight/e-mail-formatter-text-highlight.c +++ b/modules/text-highlight/e-mail-formatter-text-highlight.c @@ -105,6 +105,7 @@ get_syntax (EMailPart *part, if (filename != NULL) { gchar *ext = g_strrstr (filename, "."); if (ext != NULL) { + g_free (syntax); syntax = (gchar *) get_syntax_for_ext (ext + 1); syntax = syntax ? g_strdup (syntax) : NULL; } -- cgit v1.2.3