summaryrefslogtreecommitdiff
path: root/embed/ephy-about-handler.c
diff options
context:
space:
mode:
authorJan-Michael Brummer <jan.brummer@tabos.org>2019-07-21 13:49:57 +0200
committerJan-Michael Brummer <jan.brummer@tabos.org>2019-07-21 13:49:57 +0200
commit5ed235c5450cadf60695e1f98c5186023f080371 (patch)
treee766775c1b26ed68bb18846d3471551a309821e6 /embed/ephy-about-handler.c
parent9a479479933c91fded146426c2efbb5853a96fff (diff)
downloadepiphany-5ed235c5450cadf60695e1f98c5186023f080371.tar.gz
Fix memory leak in ephy-about-handler
Diffstat (limited to 'embed/ephy-about-handler.c')
-rw-r--r--embed/ephy-about-handler.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/embed/ephy-about-handler.c b/embed/ephy-about-handler.c
index 0ff3d7f20..a03fa5c7f 100644
--- a/embed/ephy-about-handler.c
+++ b/embed/ephy-about-handler.c
@@ -396,7 +396,8 @@ history_service_query_urls_cb (EphyHistoryService *history,
for (l = urls; l; l = g_list_next (l)) {
EphyHistoryURL *url = (EphyHistoryURL *)l->data;
const char *snapshot;
- char *thumbnail_style = NULL;
+ g_autofree char *thumbnail_style = NULL;
+ g_autofree char *markup = NULL;
snapshot = ephy_snapshot_service_lookup_cached_snapshot_path (snapshot_service, url->url);
if (snapshot)
@@ -404,15 +405,15 @@ history_service_query_urls_cb (EphyHistoryService *history,
else
ephy_embed_shell_schedule_thumbnail_update (shell, url);
+ markup = g_markup_escape_text (url->title, -1);
g_string_append_printf (data_str,
"<a class=\"overview-item\" title=\"%s\" href=\"%s\">"
" <div class=\"overview-close-button\" title=\"%s\">&#10006;</div>"
" <span class=\"overview-thumbnail\"%s></span>"
" <span class=\"overview-title\">%s</span>"
"</a>",
- g_markup_escape_text (url->title, -1), url->url, _("Remove from overview"),
+ markup, url->url, _("Remove from overview"),
thumbnail_style ? thumbnail_style : "", url->title);
- g_free (thumbnail_style);
}
data_str = g_string_append (data_str,