From c66c73d6ec5076b1ba33e39b36419e5058021679 Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Tue, 27 Oct 2015 14:35:42 +0100 Subject: [PATCH] background: Fix a few memory leaks https://bugzilla.gnome.org/show_bug.cgi?id=757189 --- panels/background/bg-pictures-source.c | 1 + panels/background/cc-background-panel.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/panels/background/bg-pictures-source.c b/panels/background/bg-pictures-source.c index 1dcce1961..d02045fb5 100644 --- a/panels/background/bg-pictures-source.c +++ b/panels/background/bg-pictures-source.c @@ -954,6 +954,7 @@ bg_pictures_source_init (BgPicturesSource *self) G_FILE_QUERY_INFO_NONE, G_PRIORITY_LOW, priv->cancellable, dir_enum_async_ready, self); + g_free (cache_path); priv->cache_dir_monitor = g_file_monitor_directory (dir, G_FILE_MONITOR_NONE, diff --git a/panels/background/cc-background-panel.c b/panels/background/cc-background-panel.c index 52366d218..50369a8d7 100644 --- a/panels/background/cc-background-panel.c +++ b/panels/background/cc-background-panel.c @@ -289,6 +289,7 @@ on_screenshot_finished (GObject *source, if (result == NULL) { if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) { g_error_free (error); + g_free (data); return; } g_debug ("Unable to get screenshot: %s", @@ -338,8 +339,6 @@ on_screenshot_finished (GObject *source, data->monitor_rect.width, data->monitor_rect.height); - g_free (data); - /* remove the temporary file created by the shell */ g_unlink (panel->priv->screenshot_path); g_clear_pointer (&priv->screenshot_path, g_free); @@ -349,6 +348,7 @@ on_screenshot_finished (GObject *source, out: update_display_preview (panel, WID ("background-desktop-drawingarea"), priv->current_background); + g_free (data); } static gboolean