[evolution] [text-highlight] Fix a possible memory leak
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution] [text-highlight] Fix a possible memory leak
- Date: Wed, 26 Mar 2014 09:40:21 +0000 (UTC)
commit a2a29549268e8d75d0cc8c0f8de4d0542b1889b2
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]