aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomas Popela <tpopela@redhat.com>2013-09-23 23:38:01 +0800
committerMilan Crha <mcrha@redhat.com>2013-09-23 23:40:00 +0800
commit462edca861653fd33fd18a94ba975822176e3461 (patch)
treed4ab7b83a2fdb0bad242a47e128cba68cb6e9e57
parenta0f9603075cf81ef346fabffbd564f0d11446ccf (diff)
downloadgsoc2013-evolution-462edca861653fd33fd18a94ba975822176e3461.tar
gsoc2013-evolution-462edca861653fd33fd18a94ba975822176e3461.tar.gz
gsoc2013-evolution-462edca861653fd33fd18a94ba975822176e3461.tar.bz2
gsoc2013-evolution-462edca861653fd33fd18a94ba975822176e3461.tar.lz
gsoc2013-evolution-462edca861653fd33fd18a94ba975822176e3461.tar.xz
gsoc2013-evolution-462edca861653fd33fd18a94ba975822176e3461.tar.zst
gsoc2013-evolution-462edca861653fd33fd18a94ba975822176e3461.zip
Bug #708347 - Memory leak from EWebView/webkit
-rw-r--r--e-util/e-web-view.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/e-util/e-web-view.c b/e-util/e-web-view.c
index b4eb5e4d40..b60dce3128 100644
--- a/e-util/e-web-view.c
+++ b/e-util/e-web-view.c
@@ -3351,7 +3351,7 @@ add_css_rule_into_style_sheet (WebKitDOMDocument *document,
/* Check if rule exists */
for (ii = 0; ii < length; ii++) {
WebKitDOMCSSRule *rule;
- const gchar *rule_text;
+ gchar *rule_text;
gchar *rule_selector, *selector_end;
rule = webkit_dom_css_rule_list_item (rules_list, ii);
@@ -3363,8 +3363,10 @@ add_css_rule_into_style_sheet (WebKitDOMDocument *document,
/* Find the start of the style => end of the selector */
selector_end = g_strstr_len (rule_text, -1, " {");
- if (!selector_end)
+ if (!selector_end) {
+ g_free (rule_text);
continue;
+ }
rule_selector =
g_utf8_substring (
@@ -3380,6 +3382,7 @@ add_css_rule_into_style_sheet (WebKitDOMDocument *document,
}
g_free (rule_selector);
+ g_free (rule_text);
}
/* Insert the rule at the end, so it will override previously inserted */