EHTMLEditorView - Fix possible leak

This commit is contained in:
Tomas Popela
2015-05-13 13:19:38 +02:00
parent 1f32c52b1e
commit 628131ea4f

View File

@ -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;