btrfs-progs: fix uninitialized copy of btrfs_fs_devices list
authorAnand Jain <anand.jain@oracle.com>
Thu, 22 Oct 2015 03:53:39 +0000 (11:53 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 2 Nov 2015 08:35:06 +0000 (09:35 +0100)
commit0c90ac0872594d3f6abfa4a91c5c68bd50ad4472
tree1bb0e8c396314aaaedd2dc6d7f183c6ee931464e
parent1fcb190793b55317463cf1674a3d0bb2f00fe4d7
btrfs-progs: fix uninitialized copy of btrfs_fs_devices list

Noticed that at print_one_uuid() some of the members of btrfs_fs_devices
contained some junk values. It took a while to dig this further, and found
that we make a local copy of the btrfs_fs_devices list at
search_umounted_fs_uuids() and wasn't initialized properly.

Fixed using using calloc instead of malloc.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
[ switched to calloc ]
Signed-off-by: David Sterba <dsterba@suse.com>
cmds-filesystem.c