[evolution/evolution-3-12] [text-highlight] Fix a possible memory leak



commit 7c54be0edafd10f1e1d6d26c83a8cd4b011b2398
Author: Milan Crha <mcrha redhat com>
Date:   Wed Mar 26 10:38:34 2014 +0100

    [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.

 .../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 4f171ee..5946615 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;
                        }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]