From 98019f48803c313580d84575eef89d85a732c020 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 14 Oct 2004 19:42:31 +0000 Subject: [PATCH] (shortcuts_add_current_folder): Don't leak volume. (#155400, Morten Welinder) --- ChangeLog | 2 ++ ChangeLog.pre-2-10 | 2 ++ ChangeLog.pre-2-6 | 2 ++ ChangeLog.pre-2-8 | 2 ++ gtk/gtkfilechooserdefault.c | 7 +++++-- 5 files changed, 13 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 96320ebd85..c763a4fd4d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,8 @@ get text unnecessarily. (#155384, Morten Welinder) (gtk_file_chooser_default_finalize): Don't forget to unref the tooltips. (#155412, Morten Welinder) + (shortcuts_add_current_folder): Don't leak volume. (#155400, + Morten Welinder) 2004-10-12 Matthias Clasen diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 96320ebd85..c763a4fd4d 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -4,6 +4,8 @@ get text unnecessarily. (#155384, Morten Welinder) (gtk_file_chooser_default_finalize): Don't forget to unref the tooltips. (#155412, Morten Welinder) + (shortcuts_add_current_folder): Don't leak volume. (#155400, + Morten Welinder) 2004-10-12 Matthias Clasen diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 96320ebd85..c763a4fd4d 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -4,6 +4,8 @@ get text unnecessarily. (#155384, Morten Welinder) (gtk_file_chooser_default_finalize): Don't forget to unref the tooltips. (#155412, Morten Welinder) + (shortcuts_add_current_folder): Don't leak volume. (#155400, + Morten Welinder) 2004-10-12 Matthias Clasen diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 96320ebd85..c763a4fd4d 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -4,6 +4,8 @@ get text unnecessarily. (#155384, Morten Welinder) (gtk_file_chooser_default_finalize): Don't forget to unref the tooltips. (#155412, Morten Welinder) + (shortcuts_add_current_folder): Don't leak volume. (#155400, + Morten Welinder) 2004-10-12 Matthias Clasen diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c index 91113f8d1c..8a4d53bc38 100644 --- a/gtk/gtkfilechooserdefault.c +++ b/gtk/gtkfilechooserdefault.c @@ -1441,12 +1441,15 @@ shortcuts_add_current_folder (GtkFileChooserDefault *impl) strcmp (gtk_file_path_get_string (base_path), gtk_file_path_get_string (impl->current_folder)) == 0) { success = shortcuts_insert_path (impl, pos, TRUE, volume, NULL, NULL, FALSE, NULL); - if (!success) - gtk_file_system_volume_free (impl->file_system, volume); + if (success) + volume = NULL; } else success = shortcuts_insert_path (impl, pos, FALSE, NULL, impl->current_folder, NULL, FALSE, NULL); + if (volume) + gtk_file_system_volume_free (impl->file_system, volume); + if (base_path) gtk_file_path_free (base_path);