From 016ad2ad1fc50f95d336e08b353f8d1142c02c2b Mon Sep 17 00:00:00 2001 From: Benedikt Meurer <benny@xfce.org> Date: Tue, 14 Feb 2006 12:45:17 +0000 Subject: [PATCH] 2006-02-14 Benedikt Meurer <benny@xfce.org> * thunar-vfs/thunar-vfs-volume-hal.c: Work-around HAL bug #5279, where the UDIs array returned by libhal_drive_find_all_volumes() is not properly NULL-terminated. (Old svn revision: 19865) --- ChangeLog | 6 ++++++ thunar-vfs/thunar-vfs-volume-hal.c | 15 ++++++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index c56320907..dc61774f0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-02-14 Benedikt Meurer <benny@xfce.org> + + * thunar-vfs/thunar-vfs-volume-hal.c: Work-around HAL bug #5279, where + the UDIs array returned by libhal_drive_find_all_volumes() is not + properly NULL-terminated. + 2006-02-14 Benedikt Meurer <benny@xfce.org> * thunar/thunar-shortcuts-model.c: Include non-removable volumes in diff --git a/thunar-vfs/thunar-vfs-volume-hal.c b/thunar-vfs/thunar-vfs-volume-hal.c index 527147531..c3fd23e43 100644 --- a/thunar-vfs/thunar-vfs-volume-hal.c +++ b/thunar-vfs/thunar-vfs-volume-hal.c @@ -29,6 +29,9 @@ #include <mntent.h> #endif #include <stdio.h> +#ifdef HAVE_STDLIB_H +#include <stdlib.h> +#endif #include <dbus/dbus-glib-lowlevel.h> @@ -779,10 +782,16 @@ thunar_vfs_volume_manager_hal_init (ThunarVfsVolumeManagerHal *manager_hal) { /* add volumes for all given UDIs */ for (n = 0; n < n_udis; ++n) - thunar_vfs_volume_manager_hal_device_added (manager_hal->context, udis[n]); + { + /* add the volume based on the UDI */ + thunar_vfs_volume_manager_hal_device_added (manager_hal->context, udis[n]); + + /* release the UDI (HAL bug #5279) */ + free (udis[n]); + } - /* release the UDIs */ - libhal_free_string_array (udis); + /* release the UDIs array (HAL bug #5279) */ + free (udis); } /* release the hal drive */ -- GitLab