diff options
author | Milan Crha <mcrha@redhat.com> | 2014-03-26 17:38:34 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2014-03-26 17:38:34 +0800 |
commit | a2a29549268e8d75d0cc8c0f8de4d0542b1889b2 (patch) | |
tree | aa4fb0a2d800ba6a65dce49f7142f2c99f3cdf89 | |
parent | 1e051d37461c009b101f8feeec72fb540c6cbd5a (diff) | |
download | gsoc2013-evolution-a2a29549268e8d75d0cc8c0f8de4d0542b1889b2.tar gsoc2013-evolution-a2a29549268e8d75d0cc8c0f8de4d0542b1889b2.tar.gz gsoc2013-evolution-a2a29549268e8d75d0cc8c0f8de4d0542b1889b2.tar.bz2 gsoc2013-evolution-a2a29549268e8d75d0cc8c0f8de4d0542b1889b2.tar.lz gsoc2013-evolution-a2a29549268e8d75d0cc8c0f8de4d0542b1889b2.tar.xz gsoc2013-evolution-a2a29549268e8d75d0cc8c0f8de4d0542b1889b2.tar.zst gsoc2013-evolution-a2a29549268e8d75d0cc8c0f8de4d0542b1889b2.zip |
[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.
-rw-r--r-- | modules/text-highlight/e-mail-formatter-text-highlight.c | 1 |
1 files changed, 1 insertions, 0 deletions
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; } |