--- ucb/source/ucp/gvfs/directory.cxx	2006-09-17 15:54:28.000000000 +0200
+++ ucb/source/ucp/gvfs/directory.cxx	2007-03-30 12:58:58.000000000 +0200
@@ -374,24 +374,23 @@ sal_Bool DataSupplier::getData()
 		}
 
 
-		GnomeVFSFileInfo fileInfo;
-        fileInfo.name = 0;
-		while ((result = gnome_vfs_directory_read_next (dirHandle, &fileInfo)) == GNOME_VFS_OK) {
-			if( fileInfo.name && fileInfo.name[0] == '.' &&
-			    ( fileInfo.name[1] == '\0' ||
-			      ( fileInfo.name[1] == '.' && fileInfo.name[2] == '\0' ) ) )
+		GnomeVFSFileInfo *pFileInfo = gnome_vfs_file_info_new();
+		while ((result = gnome_vfs_directory_read_next (dirHandle, pFileInfo)) == GNOME_VFS_OK) {
+			if( pFileInfo->name && pFileInfo->name[0] == '.' &&
+			    ( pFileInfo->name[1] == '\0' ||
+			      ( pFileInfo->name[1] == '.' && pFileInfo->name[2] == '\0' ) ) )
 				continue;
 
 			switch ( m_pImpl->m_nOpenMode ) {
 			case ucb::OpenMode::FOLDERS:
-				if ( !(fileInfo.valid_fields & GNOME_VFS_FILE_INFO_FIELDS_TYPE) ||
-				     fileInfo.type != GNOME_VFS_FILE_TYPE_DIRECTORY )
+				if ( !(pFileInfo->valid_fields & GNOME_VFS_FILE_INFO_FIELDS_TYPE) ||
+				     pFileInfo->type != GNOME_VFS_FILE_TYPE_DIRECTORY )
 					continue;
 				break;
 				
 			case ucb::OpenMode::DOCUMENTS:
-				if ( !(fileInfo.valid_fields & GNOME_VFS_FILE_INFO_FIELDS_TYPE) ||
-				     fileInfo.type != GNOME_VFS_FILE_TYPE_REGULAR )
+				if ( !(pFileInfo->valid_fields & GNOME_VFS_FILE_INFO_FIELDS_TYPE) ||
+				     pFileInfo->type != GNOME_VFS_FILE_TYPE_REGULAR )
 					continue;
 				break;
 				
@@ -400,8 +399,9 @@ sal_Bool DataSupplier::getData()
 				break;
 			}
 			
-			m_pImpl->m_aResults.push_back( new ResultListEntry( &fileInfo ) );
+			m_pImpl->m_aResults.push_back( new ResultListEntry( pFileInfo ) );
 		}
+		g_free( pFileInfo );
 #ifdef DEBUG
 		g_warning ("Got %d directory entries", result);
 #endif
