diff --git a/ChangeLog b/ChangeLog
index c56320907045a75c2d42f68b2139285656ec6803..dc61774f0f1d7304bdf85078488ce1e3fcd0eec0 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 527147531584fb005f513674bf449a84d550ccd2..c3fd23e435266e0fd2b449f2cdc946172784004c 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 */