[gnome-settings-daemon] housekeeping: Don't access free'd memory if a volume is unmounted whilst the dialog is displayed



commit f0bce306a77e0207d337aa7ccc96d1529efc01fd
Author: Rodrigo Moya <rodrigo gnome-db org>
Date:   Fri Nov 5 11:17:02 2010 +0100

    housekeeping: Don't access free'd memory if a volume is unmounted whilst the dialog is displayed

 plugins/housekeeping/gsd-disk-space.c     |    8 +++++---
 plugins/xsettings/gsd-xsettings-manager.c |    4 +---
 2 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/plugins/housekeeping/gsd-disk-space.c b/plugins/housekeeping/gsd-disk-space.c
index 2fcc523..d9bd1a1 100644
--- a/plugins/housekeeping/gsd-disk-space.c
+++ b/plugins/housekeeping/gsd-disk-space.c
@@ -179,7 +179,7 @@ ldsm_notify_for_mount (LdsmMountInfo *mount,
         gboolean has_trash;
         gboolean has_disk_analyzer;
         gboolean retval = TRUE;
-        const gchar *path;
+        gchar *path;
 
         /* Don't show a dialog if one is already displayed */
         if (dialog)
@@ -188,7 +188,7 @@ ldsm_notify_for_mount (LdsmMountInfo *mount,
         name = g_unix_mount_guess_name (mount->mount);
         free_space = (gint64) mount->buf.f_frsize * (gint64) mount->buf.f_bavail;
         has_trash = ldsm_mount_has_trash (mount);
-        path = g_unix_mount_get_mount_path (mount->mount);
+        path = g_strdup (g_unix_mount_get_mount_path (mount->mount));
 
         program = g_find_program_in_path (DISK_SPACE_ANALYZER);
         has_disk_analyzer = (program != NULL);
@@ -216,7 +216,7 @@ ldsm_notify_for_mount (LdsmMountInfo *mount,
                 break;
         case GSD_LDSM_DIALOG_RESPONSE_ANALYZE:
                 retval = FALSE;
-                ldsm_analyze_path (g_unix_mount_get_mount_path (mount->mount));
+                ldsm_analyze_path (path);
                 break;
         case GSD_LDSM_DIALOG_RESPONSE_EMPTY_TRASH:
                 retval = TRUE;
@@ -230,6 +230,8 @@ ldsm_notify_for_mount (LdsmMountInfo *mount,
                 g_assert_not_reached ();
         }
 
+        g_free (path);
+
         return retval;
 }
 
diff --git a/plugins/xsettings/gsd-xsettings-manager.c b/plugins/xsettings/gsd-xsettings-manager.c
index 10f4d44..9053dee 100644
--- a/plugins/xsettings/gsd-xsettings-manager.c
+++ b/plugins/xsettings/gsd-xsettings-manager.c
@@ -270,8 +270,7 @@ get_dpi_from_gsettings_or_x_server (GnomeXSettingsManager *manager)
         return dpi;
 }
 
-typedef struct
-{
+typedef struct {
         gboolean    antialias;
         gboolean    hinting;
         int         dpi;
@@ -290,7 +289,6 @@ xft_settings_get (GnomeXSettingsManager *manager,
         double dpi;
         gboolean use_rgba = FALSE;
 
-
         antialiasing = g_settings_get_enum (manager->priv->plugin_settings, FONT_ANTIALIASING_KEY);
         hinting = g_settings_get_enum (manager->priv->plugin_settings, FONT_HINTING_KEY);
         rgba_order = g_settings_get_enum (manager->priv->plugin_settings, FONT_RGBA_ORDER_KEY);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]