[gnome-commander] Fix for bug introduced in commit af01e037e70c9cab006580052564b6385d62cb83 (null pointer dereference)



commit 75e5a9081b9d90aef7f70e4e1ce6a4577c2c32fe
Author: Piotr Eljasiak <epiotr src gnome org>
Date:   Wed Oct 7 18:32:30 2009 +0200

    Fix for bug introduced in commit af01e037e70c9cab006580052564b6385d62cb83 (null pointer dereference)

 src/gnome-cmd-file-props-dialog.cc |   20 ++++++++++++--------
 1 files changed, 12 insertions(+), 8 deletions(-)
---
diff --git a/src/gnome-cmd-file-props-dialog.cc b/src/gnome-cmd-file-props-dialog.cc
index acc147c..d318cbf 100644
--- a/src/gnome-cmd-file-props-dialog.cc
+++ b/src/gnome-cmd-file-props-dialog.cc
@@ -412,18 +412,22 @@ inline GtkWidget *create_properties_tab (GnomeCmdFilePropsDialogPrivate *data)
 
         if (GNOME_CMD_IS_CON_DEVICE (con))
         {
-            GnomeVFSVolume *vol = gnome_cmd_con_device_get_vfs_volume (GNOME_CMD_CON_DEVICE (con));
-            gchar *fs_type = gnome_vfs_volume_get_filesystem_type (vol);
-            gchar *dev_path = gnome_vfs_volume_get_device_path (vol);
+            if (GnomeVFSVolume *vol = gnome_cmd_con_device_get_vfs_volume (GNOME_CMD_CON_DEVICE (con)))
+            {
+                gchar *fs_type = gnome_vfs_volume_get_filesystem_type (vol);
+                gchar *dev_path = gnome_vfs_volume_get_device_path (vol);
 
-            gchar *s = g_strdup_printf ("%s (%s, %s)", gnome_cmd_con_get_alias (con), dev_path, fs_type);
+                gchar *s = g_strdup_printf ("%s (%s, %s)", gnome_cmd_con_get_alias (con), dev_path, fs_type);
 
-            g_free (fs_type);
-            g_free (dev_path);
+                g_free (fs_type);
+                g_free (dev_path);
 
-            label = create_label (dialog, s);
+                label = create_label (dialog, s);
 
-            g_free (s);
+                g_free (s);
+            }
+            else
+                label = create_label (dialog, gnome_cmd_con_get_alias (con));
         }
         else
             label = create_label (dialog, gnome_cmd_con_get_alias (con));



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