From 71a811cfae2043bf27f64e765440a01bea92fe47 Mon Sep 17 00:00:00 2001 From: Seth Heeren Date: Sun, 3 Oct 2010 02:52:06 +0200 Subject: [PATCH] leaked FS structures for unsupported partition types FILESYSTEMS vector copies anyway --- src/GParted_Core.cc | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/src/GParted_Core.cc b/src/GParted_Core.cc index 13e7be29..c34aa252 100644 --- a/src/GParted_Core.cc +++ b/src/GParted_Core.cc @@ -89,15 +89,14 @@ void GParted_Core::find_supported_filesystems() { FILESYSTEMS .clear() ; - FS *fs ; + FS fs_notsupp; #ifdef BTRFS_SUPPORT btrfs fs_btrfs; FILESYSTEMS .push_back( fs_btrfs .get_filesystem_support() ) ; #else //btrfs FIXME: Add full support when on-disk-format stabilized - fs = new( FS ) ; - fs ->filesystem = GParted::FS_BTRFS ; - FILESYSTEMS .push_back( * fs ) ; + fs_notsupp.filesystem = GParted::FS_BTRFS; + FILESYSTEMS .push_back( fs_notsupp ) ; #endif ext2 fs_ext2; @@ -143,19 +142,16 @@ void GParted_Core::find_supported_filesystems() FILESYSTEMS .push_back( fs_xfs .get_filesystem_support() ) ; //lvm2 physical volume -- not a file system - fs = new( FS ) ; - fs ->filesystem = GParted::FS_LVM2 ; - FILESYSTEMS .push_back( * fs ) ; + fs_notsupp .filesystem = GParted::FS_LVM2 ; + FILESYSTEMS .push_back( fs_notsupp ) ; //luks encryption-- not a file system - fs = new( FS ) ; - fs ->filesystem = GParted::FS_LUKS ; - FILESYSTEMS .push_back( * fs ) ; + fs_notsupp .filesystem = GParted::FS_LUKS ; + FILESYSTEMS .push_back( fs_notsupp ) ; //unknown file system (default when no match is found) - fs = new( FS ) ; - fs ->filesystem = GParted::FS_UNKNOWN ; - FILESYSTEMS .push_back( * fs ) ; + fs_notsupp .filesystem = GParted::FS_UNKNOWN ; + FILESYSTEMS .push_back( fs_notsupp ) ; } void GParted_Core::set_user_devices( const std::vector & user_devices )