btrfs-progs: super-recover: fix double free fs_devices memory
authorWang Shilong <wangshilong1991@gmail.com>
Thu, 18 Sep 2014 09:01:12 +0000 (05:01 -0400)
committerDavid Sterba <dsterba@suse.cz>
Fri, 10 Oct 2014 08:38:32 +0000 (10:38 +0200)
commit0d84aa903a51c472f273b02da98da2f6160e4289
treed3d65bf62e589c7f93e1fd24e89cb5301c70166b
parentd0b24918f6a593969ccbdcf861c142ba2ccc67b7
btrfs-progs: super-recover: fix double free fs_devices memory

super-recover collects btrfs devices infomation using existed
functions scan_one_devices().

Problem is fs_devices is freed twice in close_ctree() and
free_recover_superblock() for super correction path.

Fix this problem by checking whether fs_devices memory
have been freed before we free it.

Cc: Eric Sandeen <sandeen@redhat.com>
Cc: Chris Murphy <lists@colorremedies.com>
Acked-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Wang Shilong <wangshilong1991@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
super-recover.c