summaryrefslogtreecommitdiff
path: root/gtk/gtkrecentmanager.c
diff options
context:
space:
mode:
authorLauri Kasanen <curaga@operamail.com>2016-11-11 11:36:20 +0200
committerMatthias Clasen <mclasen@redhat.com>2016-11-14 14:26:34 -0500
commit8b75268d1ce144c99066cdcbc50a34ade31e33d1 (patch)
treea5f122c03404f028112dfe70bae47103167268d8 /gtk/gtkrecentmanager.c
parent34e26017e3c2432a6675e5ce6a1c64163a05e4fb (diff)
downloadgtk+-8b75268d1ce144c99066cdcbc50a34ade31e33d1.tar.gz
recent-manager: Fix a memory leak caused by "recent-manager: Add a limit to the list's size"
Signed-off-by: Lauri Kasanen <curaga@operamail.com> https://bugzilla.gnome.org/show_bug.cgi?id=773587
Diffstat (limited to 'gtk/gtkrecentmanager.c')
-rw-r--r--gtk/gtkrecentmanager.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gtk/gtkrecentmanager.c b/gtk/gtkrecentmanager.c
index fe5f03f2ba..f2dd510c5d 100644
--- a/gtk/gtkrecentmanager.c
+++ b/gtk/gtkrecentmanager.c
@@ -1481,7 +1481,10 @@ gtk_recent_manager_clamp_to_size (GtkRecentManager *manager,
uris = g_bookmark_file_get_uris (priv->recent_items, &n_uris);
if (n_uris < size)
+ {
+ g_strfreev (uris);
return;
+ }
for (i = 0; i < n_uris - size; i++)
{