[evolution] EHTMLEditorView - Fix possible leak



commit 628131ea4f030fe7ddd91dadb1f46cbd13659a71
Author: Tomas Popela <tpopela redhat com>
Date:   Wed May 13 13:19:38 2015 +0200

    EHTMLEditorView - Fix possible leak

 e-util/e-html-editor-view.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/e-util/e-html-editor-view.c b/e-util/e-html-editor-view.c
index e0325e5..51f068c 100644
--- a/e-util/e-html-editor-view.c
+++ b/e-util/e-html-editor-view.c
@@ -1516,7 +1516,8 @@ html_editor_view_check_magic_links (EHTMLEditorView *view,
        }
 
        node_text = webkit_dom_text_get_whole_text (WEBKIT_DOM_TEXT (node));
-       if (!node_text || !(*node_text) || !g_utf8_validate (node_text, -1, NULL))
+       if (!(node_text && *node_text) || !g_utf8_validate (node_text, -1, NULL))
+               g_free (node_text);
                return;
 
        if (strstr (node_text, "@") && !strstr (node_text, "://")) {
@@ -2547,7 +2548,7 @@ body_keypress_event_cb (WebKitDOMElement *element,
        if (view->priv->return_key_pressed) {
                EHTMLEditorViewHistoryEvent *ev;
 
-               /* Insert new hiisvent for Return to have the right coordinates.
+               /* Insert new history event for Return to have the right coordinates.
                 * The fragment will be added later. */
                ev = g_new0 (EHTMLEditorViewHistoryEvent, 1);
                ev->type = HISTORY_INPUT;


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