From 866cc139fea2f93da109a2b2fed65feb84e6aabc Mon Sep 17 00:00:00 2001 From: Monsta Date: Thu, 6 Nov 2014 15:10:46 +0300 Subject: don't leak memory --- baobab/src/baobab.c | 1 + gsearchtool/gsearchtool-callbacks.c | 5 +++-- gsearchtool/gsearchtool-support.c | 8 ++++---- mate-screenshot/screenshot-dialog.c | 1 + 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/baobab/src/baobab.c b/baobab/src/baobab.c index cb566afd..9a2144e5 100644 --- a/baobab/src/baobab.c +++ b/baobab/src/baobab.c @@ -189,6 +189,7 @@ update_scan_label (void) label = GTK_WIDGET (gtk_builder_get_object (baobab.main_ui, "label1")); gtk_label_set_markup (GTK_LABEL (label), markup); + g_free (markup); } void diff --git a/gsearchtool/gsearchtool-callbacks.c b/gsearchtool/gsearchtool-callbacks.c index 806be3e7..be2244e9 100644 --- a/gsearchtool/gsearchtool-callbacks.c +++ b/gsearchtool/gsearchtool-callbacks.c @@ -828,14 +828,15 @@ move_to_trash_cb (GtkAction * action, COLUMN_LOCALE_FILE, &locale_filename, COLUMN_NO_FILES_FOUND, &no_files_found, -1); - utf8_filename = g_filename_display_name (locale_filename); if (no_files_found) { g_free (utf8_basename); g_free (locale_filename); return; } - + + utf8_filename = g_filename_display_name (locale_filename); + if (idx + 1 == total) { last_selected_path = gtk_tree_model_get_path (GTK_TREE_MODEL (gsearch->search_results_list_store), &iter); } diff --git a/gsearchtool/gsearchtool-support.c b/gsearchtool/gsearchtool-support.c index 182934ca..a120967b 100644 --- a/gsearchtool/gsearchtool-support.c +++ b/gsearchtool/gsearchtool-support.c @@ -92,8 +92,6 @@ is_quick_search_excluded_path (const gchar * path) gboolean results = FALSE; gint i; - settings = g_settings_new ("org.mate.search-tool"); - dir = g_strdup (path); /* Remove trailing G_DIR_SEPARATOR. */ @@ -109,6 +107,8 @@ is_quick_search_excluded_path (const gchar * path) } g_free (dir); + settings = g_settings_new ("org.mate.search-tool"); + /* Check path against the Quick-Search-Excluded-Paths list. */ exclude_path_list = g_settings_get_strv (settings, "quick-search-excluded-paths"); @@ -169,8 +169,6 @@ is_second_scan_excluded_path (const gchar * path) gboolean results = FALSE; gint i; - settings = g_settings_new ("org.mate.search-tool"); - dir = g_strdup (path); /* Remove trailing G_DIR_SEPARATOR. */ @@ -186,6 +184,8 @@ is_second_scan_excluded_path (const gchar * path) } g_free (dir); + settings = g_settings_new ("org.mate.search-tool"); + /* Check path against the Quick-Search-Excluded-Paths list. */ exclude_path_list = g_settings_get_strv (settings, "quick-search-second-scan-excluded-paths"); diff --git a/mate-screenshot/screenshot-dialog.c b/mate-screenshot/screenshot-dialog.c index e3a9b923..f9c9a331 100644 --- a/mate-screenshot/screenshot-dialog.c +++ b/mate-screenshot/screenshot-dialog.c @@ -181,6 +181,7 @@ drag_data_get (GtkWidget *widget, uris[1] = NULL; gtk_selection_data_set_uris (selection_data, uris); + g_strfreev (uris); } else if (info == TYPE_IMAGE_PNG) { -- cgit v1.2.1