From 628131ea4f030fe7ddd91dadb1f46cbd13659a71 Mon Sep 17 00:00:00 2001 From: Tomas Popela Date: Wed, 13 May 2015 13:19:38 +0200 Subject: [PATCH] EHTMLEditorView - Fix possible leak --- e-util/e-html-editor-view.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/e-util/e-html-editor-view.c b/e-util/e-html-editor-view.c index e0325e5340..51f068c63c 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;